Documentation ¶
Index ¶
- Constants
- func AddCappHasPlacementAnnotation(capp cappv1alpha1.Capp, managedClusterName string, ctx context.Context, ...) error
- func GetDecisionClusterName(placementDecisions *clusterv1beta1.PlacementDecisionList, log logr.Logger) string
- func GetPlacementDecisionList(ctx context.Context, placementRef string, placementsNamespace string, ...) (*clusterv1beta1.PlacementDecisionList, error)
- func UpdateCappDestination(capp cappv1alpha1.Capp, managedClusterName string, ctx context.Context, ...) error
Constants ¶
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.