Skip to content

Commit

Permalink
chore: remove the postgresql label (cloudnative-pg#2628)
Browse files Browse the repository at this point in the history
Stop supporting the `postgresql` label, as in 1.18 the more canonical
`cnpg.io/cluster` label was introduced to replace it.

Closes cloudnative-pg#2623

Signed-off-by: Armando Ruocco <[email protected]>
  • Loading branch information
armru authored Sep 12, 2023
1 parent 30ec56e commit e133fd9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion pkg/specs/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ func PodWithExistingStorage(cluster apiv1.Cluster, nodeSerial int) *corev1.Pod {
pod := &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
utils.OldClusterLabelName: cluster.Name, //nolint
utils.ClusterLabelName: cluster.Name,
utils.InstanceNameLabelName: podName,
utils.PodRoleLabelName: string(utils.PodRoleInstance),
Expand Down
14 changes: 0 additions & 14 deletions pkg/utils/labels_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ const (
// ClusterLabelName is the name of cluster which the backup CR belongs to
ClusterLabelName = "cnpg.io/cluster"

// OldClusterLabelName label is applied to objects to link them to the owning
// cluster.
//
// Deprecated: please use ClusterLabelName instead
//
// TODO: delete as soon as possible. releases 1.16, 1.17 still
// have embedded logic relying on "postgresql" as the cluster label
// in controllers/cluster_controller.go mapNodeToClusters() at minimum.
// Release 1.18 does not have that logic
//
// IMPORTANT: Removing this is a breaking change and should be announced in Release Notes
// utils.ClusterLabelName should be used instead where possible.
OldClusterLabelName = "postgresql" // Deprecated: use ClusterLabelName going forward

// JobRoleLabelName is the name of the label containing the purpose of the executed job
JobRoleLabelName = "cnpg.io/jobRole"

Expand Down

0 comments on commit e133fd9

Please sign in to comment.