MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / SetInstanceRole

Function SetInstanceRole

pkg/utils/labels_annotations.go:572–578  ·  view source on GitHub ↗

SetInstanceRole sets both ClusterRoleLabelName and ClusterInstanceRoleLabelName on the given ObjectMeta

(meta *metav1.ObjectMeta, role string)

Source from the content-addressed store, hash-verified

570
571// SetInstanceRole sets both ClusterRoleLabelName and ClusterInstanceRoleLabelName on the given ObjectMeta
572func SetInstanceRole(meta *metav1.ObjectMeta, role string) {
573 if meta.Labels == nil {
574 meta.Labels = map[string]string{}
575 }
576 meta.Labels[ClusterRoleLabelName] = role
577 meta.Labels[ClusterInstanceRoleLabelName] = role
578}
579
580// MergeObjectsMetadata is capable of merging the labels and annotations of two objects metadata
581func MergeObjectsMetadata(receiver client.Object, giver client.Object) {

Callers 5

createMajorUpgradeJobFunction · 0.92
updateRoleLabelsFunction · 0.92
replicas_test.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected