Documentation ¶
Index ¶
- Constants
- func CreateManifestWork(capp cappv1alpha1.Capp, managedClusterName string, logger logr.Logger, ...) error
- func EnsureFinalizer(ctx context.Context, capp cappv1alpha1.Capp, r client.Client) error
- func GenerateMWName(capp cappv1alpha1.Capp) string
- func GenerateManifestWorkGeneric(name string, namespace string, manifests []workv1.Manifest, ...) *workv1.ManifestWork
- func HandleCappDeletion(ctx context.Context, capp cappv1alpha1.Capp, log logr.Logger, r client.Client) error
- func SetManifestWorkCappAnnotations(mw workv1.ManifestWork, capp cappv1alpha1.Capp)
Constants ¶
const ( NamespaceManifestWorkPrefix = "mw-create-" CappNameKey = "rcs.dana.io/capp-name" CappNamespaceKey = "rcs.dana.io/capp-namespace" )
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 ¶
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.