layers

package
v0.3.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package layers provides an interface for processing AddonsLayers.

Index

Constants

This section is empty.

Variables

View Source
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) GetName

func (l *KraanLayer) GetName() string

GetName gets the layer name.

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

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) IsHold

func (l *KraanLayer) IsHold() bool

IsHold returns hold status.

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 (l *KraanLayer) RevisionReady(conditions []metav1.Condition, revision string) (bool, string)

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) SetHold

func (l *KraanLayer) SetHold()

SetHold sets the hold status.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL