Skip to content

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Jan 7, 2020

and replace code were the label "version" was hard-coded

pod_phase = 'Failing over'
new_master_node = ''
labels = 'spilo-role=master,version=acid-minimal-cluster'
labels = 'spilo-role=master,cluster-name=acid-minimal-cluster'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont like that this is hard coded. We should have the end to end test covering that the label can change to make sure config variable is picked up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but there are even more selectors hard coded here: spilo-role, name etc.
But true, I could add a test on changing such labels

@Jan-M
Copy link
Member

Jan-M commented Feb 19, 2020

👍

@FxKu
Copy link
Member Author

FxKu commented Feb 19, 2020

👍

1 similar comment
@RafiaSabih
Copy link
Contributor

👍

@FxKu FxKu merged commit 742d733 into master Feb 19, 2020
@FxKu FxKu added this to the 1.4 milestone Feb 20, 2020
@Bryji
Copy link

Bryji commented Feb 28, 2020

This was a breaking change for us. The operator was no longer able to update statefulsets as Kubernetes does not allow you to change the label on an existing sts:
time="2020-02-28T18:50:54Z" level=warning msg="error while syncing cluster state: could not sync statefulsets: could not update statefulset: could not patch statefulset spec \"postgres-operator/platops-postgres-operator-platypusdb\": StatefulSet.apps \"platops-postgres-operator-platypusdb\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden" cluster-name=postgres-operator/platops-postgres-operator-platypusdb pkg=cluster
Fix was to set the cluster_name_label back to "version" in our base values file

  configKubernetes:
    cluster_name_label: "version"

Posting the comment here for any others looking for the root cause/fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants