Documentation ¶
Overview ¶
Package layers provides an interface for processing AddonsLayers.
Index ¶
- Variables
- type KraanLayer
- func (l *KraanLayer) CheckK8sVersion() bool
- func (l *KraanLayer) DependenciesDeployed() bool
- func (l *KraanLayer) GetAddonsLayer() *kraanv1alpha1.AddonsLayer
- func (l *KraanLayer) GetContext() context.Context
- func (l *KraanLayer) GetDelay() time.Duration
- func (l *KraanLayer) GetFullStatus() *kraanv1alpha1.AddonsLayerStatus
- func (l *KraanLayer) GetLogger() logr.Logger
- func (l *KraanLayer) GetName() string
- func (l *KraanLayer) GetRequiredK8sVersion() string
- func (l *KraanLayer) GetSourceKey() string
- func (l *KraanLayer) GetSourcePath() string
- func (l *KraanLayer) GetSpec() *kraanv1alpha1.AddonsLayerSpec
- func (l *KraanLayer) GetStatus() string
- func (l *KraanLayer) GetTimeout() time.Duration
- func (l *KraanLayer) IsDelayed() bool
- func (l *KraanLayer) IsHold() bool
- func (l *KraanLayer) IsUpdated() bool
- func (l *KraanLayer) NeedsRequeue() bool
- func (l *KraanLayer) RevisionReady(conditions []metav1.Condition, revision string) (bool, string)
- func (l *KraanLayer) SetDelayedRequeue()
- func (l *KraanLayer) SetDeleted()
- func (l *KraanLayer) SetHold()
- func (l *KraanLayer) SetRequeue()
- func (l *KraanLayer) SetStatusApplying()
- func (l *KraanLayer) SetStatusDeployed()
- func (l *KraanLayer) SetStatusK8sVersion()
- func (l *KraanLayer) SetStatusPending()
- func (l *KraanLayer) SetStatusPruning()
- func (l *KraanLayer) SetUpdated()
- func (l *KraanLayer) StatusUpdate(status, message string)
- type Layer
Constants ¶
This section is empty.
Variables ¶
var ( MaxConditions = 10 RootPath = "/data" )
MaxConditions is the maximum number of condtions to retain.
Functions ¶
This section is empty.
Types ¶
type KraanLayer ¶
type KraanLayer struct { Name string `json:"layer-name"` Layer `json:"-"` // contains filtered or unexported fields }
KraanLayer is the Schema for the addons API.
func (*KraanLayer) CheckK8sVersion ¶
func (l *KraanLayer) CheckK8sVersion() bool
CheckK8sVersion checks if the cluster api server version is equal to or above the required version.
func (*KraanLayer) DependenciesDeployed ¶
func (l *KraanLayer) DependenciesDeployed() bool
DependenciesDeployed checks that all the layers this layer is dependent on are deployed.
func (*KraanLayer) GetAddonsLayer ¶
func (l *KraanLayer) GetAddonsLayer() *kraanv1alpha1.AddonsLayer
GetAddonsLayer returns the AddonsLayers Spec.
func (*KraanLayer) GetContext ¶
func (l *KraanLayer) GetContext() context.Context
GetContext gets the context.
func (*KraanLayer) GetDelay ¶
func (l *KraanLayer) GetDelay() time.Duration
GetDelay returns the delay period.
func (*KraanLayer) GetFullStatus ¶
func (l *KraanLayer) GetFullStatus() *kraanv1alpha1.AddonsLayerStatus
GetFullStatus returns the AddonsLayers Status sub resource.
func (*KraanLayer) GetLogger ¶
func (l *KraanLayer) GetLogger() logr.Logger
GetLogger gets the layer logger.
func (*KraanLayer) GetRequiredK8sVersion ¶
func (l *KraanLayer) GetRequiredK8sVersion() string
GetRequiredK8sVersion returns the K8s Version required.
func (*KraanLayer) GetSourceKey ¶
func (l *KraanLayer) GetSourceKey() string
GetSourceKey gets the namespace and name of the source used by layer.
func (*KraanLayer) GetSourcePath ¶
func (l *KraanLayer) GetSourcePath() string
GetSourcePath gets the path to an addons layer's top directory in the local filesystem.
func (*KraanLayer) GetSpec ¶
func (l *KraanLayer) GetSpec() *kraanv1alpha1.AddonsLayerSpec
GetSpec returns the AddonsLayers Spec.
func (*KraanLayer) GetStatus ¶
func (l *KraanLayer) GetStatus() string
GetStatus returns the status.
func (*KraanLayer) GetTimeout ¶
func (l *KraanLayer) GetTimeout() time.Duration
GetTimeout returns the timeout period.
func (*KraanLayer) IsDelayed ¶
func (l *KraanLayer) IsDelayed() bool
IsDelayed returns true if the requeue should be delayed.
func (*KraanLayer) IsUpdated ¶
func (l *KraanLayer) IsUpdated() bool
IsUpdated returns true if an update to the AddonsLayer data has occurred.
func (*KraanLayer) NeedsRequeue ¶
func (l *KraanLayer) NeedsRequeue() bool
NeedsRequeue returns true if the AddonsLayer needed to be reprocessed.
func (*KraanLayer) RevisionReady ¶
func (*KraanLayer) SetDelayedRequeue ¶
func (l *KraanLayer) SetDelayedRequeue()
SetDelayedRequeue sets the delayed flag to cause the AddonsLayer to delay the requeue.
func (*KraanLayer) SetDeleted ¶
func (l *KraanLayer) SetDeleted()
func (*KraanLayer) SetRequeue ¶
func (l *KraanLayer) SetRequeue()
SetRequeue sets the requeue flag to cause the AddonsLayer to be requeued.
func (*KraanLayer) SetStatusApplying ¶
func (l *KraanLayer) SetStatusApplying()
SetStatusApplying sets the addon layer's status to apply in progress.
func (*KraanLayer) SetStatusDeployed ¶
func (l *KraanLayer) SetStatusDeployed()
SetStatusDeployed sets the addon layer's status to deployed.
func (*KraanLayer) SetStatusK8sVersion ¶
func (l *KraanLayer) SetStatusK8sVersion()
SetStatusK8sVersion sets the addon layer's status to waiting for required K8s Version.
func (*KraanLayer) SetStatusPending ¶
func (l *KraanLayer) SetStatusPending()
SetStatusPending sets the addon layer's status to pending.
func (*KraanLayer) SetStatusPruning ¶
func (l *KraanLayer) SetStatusPruning()
SetStatusPruning sets the addon layer's status to pruning.
func (*KraanLayer) SetUpdated ¶
func (l *KraanLayer) SetUpdated()
SetUpdated sets the updated flag to cause the AddonsLayer to update the custom resource.
func (*KraanLayer) StatusUpdate ¶
func (l *KraanLayer) StatusUpdate(status, message string)
StatusUpdate sets the addon layer's status.
type Layer ¶
type Layer interface { SetStatusK8sVersion() SetStatusApplying() SetStatusPruning() SetStatusPending() SetStatusDeployed() StatusUpdate(status, message string) IsHold() bool SetHold() DependenciesDeployed() bool GetSourceKey() string GetStatus() string GetName() string GetLogger() logr.Logger GetContext() context.Context GetSourcePath() string GetTimeout() time.Duration IsUpdated() bool NeedsRequeue() bool IsDelayed() bool GetDelay() time.Duration SetRequeue() SetDelayedRequeue() SetUpdated() SetDeleted() GetRequiredK8sVersion() string CheckK8sVersion() bool GetFullStatus() *kraanv1alpha1.AddonsLayerStatus GetSpec() *kraanv1alpha1.AddonsLayerSpec GetAddonsLayer() *kraanv1alpha1.AddonsLayer RevisionReady(conditions []metav1.Condition, revision string) (bool, string) }
Layer defines the interface for managing the layer.
func CreateLayer ¶
func CreateLayer(ctx context.Context, client client.Client, k8client kubernetes.Interface, log logr.Logger, recorder record.EventRecorder, scheme *runtime.Scheme, addonsLayer *kraanv1alpha1.AddonsLayer) Layer
CreateLayer creates a layer object.