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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationKeyHasPlacement is the key used to store the managed cluster name in an annotation on a Capp resource
	AnnotationKeyHasPlacement = "rcs.dana.io/has-placement"
)

Variables

This section is empty.

Functions

func AddCappHasPlacementAnnotation

func AddCappHasPlacementAnnotation(capp cappv1alpha1.Capp, managedClusterName string, ctx context.Context, r client.Client) error

AddCappHasPlacementAnnotation adds an annotation to the Capp custom resource that indicates the managed cluster where the application is placed.

func GetDecisionClusterName

func GetDecisionClusterName(placementDecisions *clusterv1beta1.PlacementDecisionList, log logr.Logger) string

GetDecisionClusterName retrieves the name of a managed cluster from a PlacementDecisionList.

func GetPlacementDecisionList

func GetPlacementDecisionList(ctx context.Context, placementRef string, placementsNamespace string, r client.Client) (*clusterv1beta1.PlacementDecisionList, error)

GetPlacementDecisionList fetches a PlacementDecisionList by label. The function takes as parameters an instance of Capp, an instance of logr.Logger, a context.Context, a string placementRef used to filter the PlacementDecisionList and the namespace where the PlacementDecisions are expected. The function returns a pointer to a PlacementDecisionList and an error in case of failure.

func UpdateCappDestination

func UpdateCappDestination(capp cappv1alpha1.Capp, managedClusterName string, ctx context.Context, r client.Client) error

UpdateCappDestination updates the Site field in the Status.ApplicationLinks object of a Capp custom resource. The Site field specifies the managed cluster name where the application is running. This function also calls the AddCappHasPlacementAnnotation function to add an annotation to the Capp resource that indicates the placement of the application.

Types

This section is empty.

Jump to

Keyboard shortcuts

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