adapters

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NamespaceManifestWorkPrefix = "mw-create-"
	CappNameKey                 = "rcs.dana.io/capp-name"
	CappNamespaceKey            = "rcs.dana.io/capp-namespace"
)
View Source
const FinalizerCleanupCapp = "dana.io/capp-cleanup"

Variables

This section is empty.

Functions

func CreateManifestWork

func CreateManifestWork(capp cappv1alpha1.Capp, managedClusterName string, logger logr.Logger, client client.Client, ctx context.Context, e record.EventRecorder, manifests []workv1.Manifest) error

CreateManifestWork uses the Kubernetes client to create a ManifestWork resource from the specified capp, cluster name, manifests, and logs the process.

func EnsureFinalizer

func EnsureFinalizer(ctx context.Context, capp cappv1alpha1.Capp, r client.Client) error

EnsureFinalizer ensures the Capp has the finalizer specified (FinalizerCleanupCapp).

func GenerateMWName

func GenerateMWName(capp cappv1alpha1.Capp) string

GenerateMWName returns a manifestWork name combining NamespaceManifestWorkPrefix, capp namespace and name.

func GenerateManifestWorkGeneric

func GenerateManifestWorkGeneric(name string, namespace string, manifests []workv1.Manifest, machineConfigOptions ...workv1.ManifestConfigOption) *workv1.ManifestWork

GenerateManifestWorkGeneric generates a new Kubernetes manifest work object with the specified name, namespace, and manifests. It takes an optional list of machine configuration options as well.

func HandleCappDeletion

func HandleCappDeletion(ctx context.Context, capp cappv1alpha1.Capp, log logr.Logger, r client.Client) error

HandleCappDeletion handles the deletion of a Capp custom resource. It checks if the resource has a deletion timestamp and contains the specified finalizer. If so, it finalizes the Capp by cleaning up associated resources. It removes the finalizer once cleanup is complete and updates the resource.

func SetManifestWorkCappAnnotations

func SetManifestWorkCappAnnotations(mw workv1.ManifestWork, capp cappv1alpha1.Capp)

SetManifestWorkCappAnnotations sets the annotations of the specified manifest work object with the name and namespace of the specified Capp object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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