Documentation ¶
Overview ¶
Package annotation allows to set custom install, upgrade or uninstall options on custom resource objects with annotations. To create custom annotations implement the Install, Upgrade or Uninstall interface.
Example:
To disable hooks based on annotations the InstallDisableHooks is passed to the reconciler as an option.
r, err := reconciler.New( reconciler.WithChart(*w.Chart), reconciler.WithGroupVersionKind(w.GroupVersionKind), reconciler.WithInstallAnnotations(annotation.InstallDisableHook{}), )
If the reconciler detects an annotation named "helm.sdk.operatorframework.io/install-disable-hooks" on the watched custom resource it sets the install.DisableHooks option to the annotations value. For more information take a look at the InstallDisableHooks.InstallOption method.
kind: OperatorHelmKind apiVersion: test.example.com/v1 metadata: name: nginx-sample annotations: "helm.sdk.operatorframework.io/install-disable-hooks": true
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultInstallAnnotations = []Install{InstallDescription{}, InstallDisableHooks{}} DefaultUpgradeAnnotations = []Upgrade{UpgradeDescription{}, UpgradeDisableHooks{}, UpgradeForce{}} DefaultUninstallAnnotations = []Uninstall{UninstallDescription{}, UninstallDisableHooks{}} )
Functions ¶
This section is empty.
Types ¶
type Install ¶
type Install interface { Name() string InstallOption(string) helmclient.InstallOption }
Install configures an install annotation.
type InstallDescription ¶
type InstallDescription struct {
CustomName string
}
func (InstallDescription) InstallOption ¶
func (i InstallDescription) InstallOption(v string) helmclient.InstallOption
func (InstallDescription) Name ¶
func (i InstallDescription) Name() string
type InstallDisableHooks ¶
type InstallDisableHooks struct {
CustomName string
}
func (InstallDisableHooks) InstallOption ¶
func (i InstallDisableHooks) InstallOption(val string) helmclient.InstallOption
func (InstallDisableHooks) Name ¶
func (i InstallDisableHooks) Name() string
type Uninstall ¶
type Uninstall interface { Name() string UninstallOption(string) helmclient.UninstallOption }
Uninstall configures an install annotation.
type UninstallDescription ¶
type UninstallDescription struct {
CustomName string
}
func (UninstallDescription) Name ¶
func (u UninstallDescription) Name() string
func (UninstallDescription) UninstallOption ¶
func (u UninstallDescription) UninstallOption(v string) helmclient.UninstallOption
type UninstallDisableHooks ¶
type UninstallDisableHooks struct {
CustomName string
}
func (UninstallDisableHooks) Name ¶
func (u UninstallDisableHooks) Name() string
func (UninstallDisableHooks) UninstallOption ¶
func (u UninstallDisableHooks) UninstallOption(val string) helmclient.UninstallOption
type Upgrade ¶
type Upgrade interface { Name() string UpgradeOption(string) helmclient.UpgradeOption }
Upgrade configures an upgrade annotation.
type UpgradeDescription ¶
type UpgradeDescription struct {
CustomName string
}
func (UpgradeDescription) Name ¶
func (u UpgradeDescription) Name() string
func (UpgradeDescription) UpgradeOption ¶
func (u UpgradeDescription) UpgradeOption(v string) helmclient.UpgradeOption
type UpgradeDisableHooks ¶
type UpgradeDisableHooks struct {
CustomName string
}
func (UpgradeDisableHooks) Name ¶
func (u UpgradeDisableHooks) Name() string
func (UpgradeDisableHooks) UpgradeOption ¶
func (u UpgradeDisableHooks) UpgradeOption(val string) helmclient.UpgradeOption
type UpgradeForce ¶
type UpgradeForce struct {
CustomName string
}
func (UpgradeForce) Name ¶
func (u UpgradeForce) Name() string
func (UpgradeForce) UpgradeOption ¶
func (u UpgradeForce) UpgradeOption(val string) helmclient.UpgradeOption