Skip to content

Commit

Permalink
feat(pluginpresets) Documentation and log update
Browse files Browse the repository at this point in the history
  • Loading branch information
gciezkowski-acc committed Jan 10, 2025
1 parent 6ff5b75 commit c080455
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/user-guides/plugin/plugin-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ In case the _PluginPreset_ is updated all of the Plugin instances that are manag
Changes that are done directly on a _Plugin_ which was created from a _PluginPreset_ will be overwritten immediately by the _PluginPreset_ Controller. All changes must be performed on the _PluginPreset_ itself.
If a _Plugin_ already existed with the same name as the _PluginPreset_ would create, this _Plugin_ will be ignored in following reconciliations.

To prevent accidental deletion of the _Plugin_, the _PluginPreset_ has the annotation `greenhouse.sap/prevent-deletion`. To delete the pluginPreset along with the plugins, you must first remove the annotation.

A __PluginPreset__ with the annotation `greenhouse.sap/prevent-deletion` may not be deleted. This is to prevent the accidental deletion of a __PluginPreset__ including the managed __Plugins__ and their deployed Helm releases. Only after removing the annotation it is possible to delete a __PluginPreset__.
## Example _PluginPreset_

```yaml
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/pluginpreset_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func ValidateDeletePluginPreset(_ context.Context, _ client.Client, obj runtime.
var allErrs field.ErrorList
if _, ok := pluginPreset.Annotations[preventDeletionAnnotation]; ok {
allErrs = append(allErrs, field.Invalid(field.NewPath("metadata").Child("annotation").Child(preventDeletionAnnotation),
pluginPreset.Annotations, "Plugin preset has prevent deletion annotation"))
pluginPreset.Annotations, fmt.Sprintf("PluginPreset with annotation '%s' set may not be deleted.", preventDeletionAnnotation)))
}

if len(allErrs) > 0 {
Expand Down

0 comments on commit c080455

Please sign in to comment.