Documentation ¶
Index ¶
- type Component
- type ComponentContext
- func NewContext(log vzlog.VerrazzanoLogger, c clipkg.Client, actualCR *v1alpha1.Verrazzano, ...) (ComponentContext, error)
- func NewFakeContext(c clipkg.Client, actualCR *v1alpha1.Verrazzano, ...) ComponentContext
- func NewMinimalContext(c clipkg.Client, log vzlog.VerrazzanoLogger) (ComponentContext, error)
- type ComponentInfo
- type ComponentInstaller
- type ComponentUninstaller
- type ComponentUpgrader
- type ComponentValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component interface { ComponentInfo ComponentInstaller ComponentUninstaller ComponentUpgrader ComponentValidator Reconcile(ctx ComponentContext) error }
Component interface defines the methods implemented by components
type ComponentContext ¶
type ComponentContext interface { // Log returns the logger for the context Log() vzlog.VerrazzanoLogger // GetClient returns the controller client for the context Client() clipkg.Client // ActualCR returns the actual unmerged v1alpha1.Verrazzano resource ActualCR() *v1alpha1.Verrazzano // EffectiveCR returns the effective merged v1alpha1.Verrazzano CR EffectiveCR() *v1alpha1.Verrazzano // ActualCRV1Beta1 returns the actual unmerged v1beta1.Verrazzano resource ActualCRV1Beta1() *v1beta1.Verrazzano // EffectiveCRV1Beta1 returns the effective merged v1beta1.Verrazzano CR EffectiveCRV1Beta1() *v1beta1.Verrazzano // IsDryRun indicates the component context is in DryRun mode IsDryRun() bool // Copy returns a copy of the current context Copy() ComponentContext // Init returns a copy of the current context with an updated logging component field Init(comp string) ComponentContext // Operation specifies the logging operation field Operation(op string) ComponentContext // GetOperation returns the operation object in the context GetOperation() string // GetComponent returns the component object in the context GetComponent() string }
ComponentContext Defines the context objects required for Component operations
func NewContext ¶
func NewContext(log vzlog.VerrazzanoLogger, c clipkg.Client, actualCR *v1alpha1.Verrazzano, actualV1beta1CR *v1beta1.Verrazzano, dryRun bool) (ComponentContext, error)
NewContext creates a ComponentContext from a raw CR
func NewFakeContext ¶
func NewFakeContext(c clipkg.Client, actualCR *v1alpha1.Verrazzano, actualV1beta1CR *v1beta1.Verrazzano, dryRun bool, profilesDir ...string) ComponentContext
NewFakeContext creates a fake ComponentContext for unit testing purposes c Kubernetes client actualCR The user-supplied Verrazzano CR dryRun Dry-run indicator profilesDir Optional override to the location of the profiles dir; if not provided, EffectiveCR == ActualCR
func NewMinimalContext ¶ added in v1.5.0
func NewMinimalContext(c clipkg.Client, log vzlog.VerrazzanoLogger) (ComponentContext, error)
NewMinimalContext creates a ComponentContext limited to kubernetes client interactions and logging
type ComponentInfo ¶
type ComponentInfo interface { // Name returns the name of the Verrazzano component Name() string // Namespace returns the namespace of the Verrazzano component Namespace() string // ShouldInstallBeforeUpgrade returns true if component can be installed before upgrade is done, default false ShouldInstallBeforeUpgrade() bool // GetDependencies returns the dependencies of this component GetDependencies() []string // IsReady Indicates whether a component is Ready for dependency components IsReady(context ComponentContext) bool // IsAvailable Indicates whether a component is Available for end users IsAvailable(context ComponentContext) (string, v1alpha1.ComponentAvailability) // IsEnabled Indicates whether or a component is enabled for installation IsEnabled(effectiveCR runtime.Object) bool // GetMinVerrazzanoVersion returns the minimum Verrazzano version required by the component GetMinVerrazzanoVersion() string // GetIngressNames returns a list of names of the ingresses associated with the component GetIngressNames(context ComponentContext) []types.NamespacedName // GetCertificateNames returns a list of names of the TLS certificates associated with the component GetCertificateNames(context ComponentContext) []types.NamespacedName // GetJsonName returns the josn name of the verrazzano component in CRD GetJSONName() string // GetOverrides returns the list of overrides for a component GetOverrides(effectiveCR runtime.Object) interface{} // MonitorOverrides indicates whether the override sources for a component need to be monitored MonitorOverrides(context ComponentContext) bool }
ComponentInfo interface defines common information and metadata about components
type ComponentInstaller ¶
type ComponentInstaller interface { // IsOperatorInstallSupported Returns true if the component supports install directly via the platform operator // - scaffolding while we move components from the scripts to the operator IsOperatorInstallSupported() bool // IsInstalled Indicates whether or not the component is installed IsInstalled(context ComponentContext) (bool, error) // PreInstall allows components to perform any pre-processing required prior to initial install PreInstall(context ComponentContext) error // Install performs the initial install of a component Install(context ComponentContext) error // PostInstall allows components to perform any post-processing required after initial install PostInstall(context ComponentContext) error }
ComponentInstaller interface defines installs operations for components that support it
type ComponentUninstaller ¶ added in v1.4.0
type ComponentUninstaller interface { // IsOperatorUninstallSupported Returns true if the component supports uninstall directly via the platform operator // - scaffolding while we move components from the scripts to the operator IsOperatorUninstallSupported() bool // PreUninstall allows components to perform any pre-processing required prior to upgrading PreUninstall(context ComponentContext) error // Uninstall will Uninstall the Verrazzano component specified in the CR.Version field Uninstall(context ComponentContext) error // PostUninstall allows components to perform any post-processing required after upgrading PostUninstall(context ComponentContext) error }
ComponentUninstaller interface defines uninstall operations
type ComponentUpgrader ¶
type ComponentUpgrader interface { // PreUpgrade allows components to perform any pre-processing required prior to upgrading PreUpgrade(context ComponentContext) error // Upgrade will upgrade the Verrazzano component specified in the CR.Version field Upgrade(context ComponentContext) error // PostUpgrade allows components to perform any post-processing required after upgrading PostUpgrade(context ComponentContext) error }
ComponentUpgrader interface defines upgrade operations for components that support it
type ComponentValidator ¶ added in v1.3.0
type ComponentValidator interface { // ValidateInstall checks if the specified Verrazzano CR is valid for this component to be installed ValidateInstall(vz *v1alpha1.Verrazzano) error // ValidateUpdate checks if the specified new Verrazzano CR is valid for this component to be updated ValidateUpdate(old *v1alpha1.Verrazzano, new *v1alpha1.Verrazzano) error // ValidateInstallV1Beta1 checks if the specified Verrazzano CR is valid for this component to be installed ValidateInstallV1Beta1(vz *v1beta1.Verrazzano) error // ValidateUpdateV1Beta1 checks if the specified new Verrazzano CR is valid for this component to be updated ValidateUpdateV1Beta1(old *v1beta1.Verrazzano, new *v1beta1.Verrazzano) error }
ComponentValidator interface defines validation operations for components that support it