lib

package
v0.109.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(lsUncachedClient, lsCachedClient, hostUncachedClient, hostCachedClient client.Client,
	finishedObjectCache *lsutil.FinishedObjectCache,
	log logging.Logger, lsMgr, hostMgr manager.Manager, args DeployerArgs, maxNumberOfWorkers int, lockingEnabled bool, callerName string) error

Add adds a deployer to the given managers using the given args.

func CreateOrUpdateExport

func CreateOrUpdateExport(ctx context.Context, kubeWriter *read_write_layer.Writer, kubeClient client.Client, deployItem *lsv1alpha1.DeployItem, values interface{}) error

CreateOrUpdateExport creates or updates the export of a deploy item.

func ExpandManagedResourceManifests

func ExpandManagedResourceManifests(origManifests []managedresource.Manifest) ([]managedresource.Manifest, error)

func ExpandManifests

func ExpandManifests(manifests []*runtime.RawExtension) ([]*runtime.RawExtension, error)

func GetKubeconfigFromSecretRef

func GetKubeconfigFromSecretRef(ctx context.Context, ref *lsv1alpha1.SecretReference, targetNamespace string,
	lsClient client.Client) ([]byte, error)

func GetKubeconfigFromTargetConfig

func GetKubeconfigFromTargetConfig(ctx context.Context, config *targettypes.KubernetesClusterTargetConfig,
	targetNamespace string, lsClient client.Client) ([]byte, error)

GetKubeconfigFromTargetConfig fetches the kubeconfig from a given config. If the config defines the target from a secret that secret is read from all provided clients.

func GetRegistryPullSecretsFromContext

func GetRegistryPullSecretsFromContext(lsCtx *lsv1alpha1.Context) []lsv1alpha1.ObjectReference

GetRegistryPullSecretsFromContext returns the object references to registry pull secrets defined by the landscaper context.

func HandleReconcileResult

func HandleReconcileResult(ctx context.Context, err lserrors.LsError, oldDeployItem, deployItem *lsv1alpha1.DeployItem,
	lsClient client.Client, lsEventRecorder record.EventRecorder, finishedObjectCache *lsutil.FinishedObjectCache) error

func IsDeployItemFinished

func IsDeployItemFinished(di *lsv1alpha1.DeployItem) bool

func NewController

func NewController(lsUncachedClient, lsCachedClient, hostUncachedClient, hostCachedClient client.Client,
	finishedObjectCache *lsutil.FinishedObjectCache,
	lsScheme *runtime.Scheme,
	lsEventRecorder record.EventRecorder,
	hostScheme *runtime.Scheme,
	args DeployerArgs,
	maxNumberOfWorkers int,
	lockingEnabled bool,
	callerName string) *controller

NewController creates a new generic deployitem controller.

func NewTypePredicate

func NewTypePredicate(dtype lsv1alpha1.DeployItemType) predicate.Predicate

func SetProviderStatus

func SetProviderStatus(di *lsv1alpha1.DeployItem, status runtime.Object, scheme *runtime.Scheme) error

SetProviderStatus sets the provider specific status for a deploy item.

Types

type Deployer

type Deployer interface {
	// Reconcile the deployitem.
	Reconcile(ctx context.Context, lsContext *lsv1alpha1.Context, di *lsv1alpha1.DeployItem, target *lsv1alpha1.ResolvedTarget) error
	// Delete the deployitem.
	Delete(ctx context.Context, lsContext *lsv1alpha1.Context, di *lsv1alpha1.DeployItem, target *lsv1alpha1.ResolvedTarget) error
	// Abort the deployitem progress.
	Abort(ctx context.Context, lsContext *lsv1alpha1.Context, di *lsv1alpha1.DeployItem, target *lsv1alpha1.ResolvedTarget) error
	// ExtensionHooks returns all registered extension hooks.
	ExtensionHooks() extension.ReconcileExtensionHooks
}

Deployer defines a controller that acts upon deployitems.

type DeployerArgs

type DeployerArgs struct {
	Name            string
	Version         string
	Identity        string
	Type            lsv1alpha1.DeployItemType
	Deployer        Deployer
	TargetSelectors []lsv1alpha1.TargetSelector
	Options         ctrl.Options
}

DeployerArgs defines the deployer arguments for the initializing a generic deployer controller.

func (*DeployerArgs) Default

func (args *DeployerArgs) Default()

Default defaults deployer arguments

func (DeployerArgs) Validate

func (args DeployerArgs) Validate() error

Validate validates the provided deployer arguments

Jump to

Keyboard shortcuts

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