lib

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 46 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 GetRegistryPullSecretsFromContext

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

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

func GetTargetClientConsideringSecondaryTarget added in v0.120.0

func GetTargetClientConsideringSecondaryTarget(
	ctx context.Context,
	primaryTargetClient client.Client,
	lsClient client.Client,
	deployItem *lsv1alpha1.DeployItem,
	secondaryTargetName *string,
	lsRestConfig *rest.Config) (targetClient client.Client, err error)

GetTargetClientConsideringSecondaryTarget is used to determine the client to read resources for custom readiness checks, export collection, and deletion groups. Usually it is the client obtained from the Target of the DeployItem. In some scenarios however, the Landscaper deploys an installer on a primary target cluster, and the installer deploys the actual application on a secondary target cluster.

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(lsRestConfig *rest.Config,
	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

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

type TargetAccess added in v0.120.0

type TargetAccess struct {
	// contains filtered or unexported fields
}

TargetAccess bundles the various objects to access a target cluster.

func NewTargetAccess added in v0.120.0

func NewTargetAccess(ctx context.Context, resolvedTarget *lsv1alpha1.ResolvedTarget,
	lsUncachedClient client.Client, lsRestConfig *rest.Config) (_ *TargetAccess, err error)

NewTargetAccess constructs a TargetAccess, handling the different subtypes of kubernetes-cluster Targets, namely: - Targets with a kubeconfig, - OIDC Targets, and - Self Targets, i.e. Targets pointing to the resource cluster watched by the Landscaper.

func (*TargetAccess) TargetClient added in v0.120.0

func (ta *TargetAccess) TargetClient() client.Client

func (*TargetAccess) TargetClientSet added in v0.120.0

func (ta *TargetAccess) TargetClientSet() kubernetes.Interface

func (*TargetAccess) TargetRestConfig added in v0.120.0

func (ta *TargetAccess) TargetRestConfig() *rest.Config

Jump to

Keyboard shortcuts

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