Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Identify statefulsets by labels rather than error prone name parsing #309

Merged

Conversation

wallrj
Copy link
Member

@wallrj wallrj commented Apr 3, 2018

  • Ensure that nodepool name label is added to the statefulsets created for each nodepool
  • Use that label when creating nodepool status for each statefulset (rather than attempting to parse the ss name)
  • Use more realistic nodepool names (including dashes) in the docs and in the tests.

Fixes: #304

Release note:

NONE

@jetstack-bot jetstack-bot added size/M and removed size/S labels Apr 3, 2018
@wallrj wallrj changed the title WIP: Identify statefulsets by labels rather than error prone name parsing Identify statefulsets by labels rather than error prone name parsing Apr 3, 2018
@munnerz munnerz added this to the v0.1 milestone Apr 3, 2018
glog.Errorf("statefulset name %q did not contain cluster name %q", ssName, cluster.Name)
}
for _, ss := range sets {
npName := ss.Labels[util.NodePoolNameLabelKey]
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the label isn't set?

Eventually I think this sort of thing should be moved into some kind of 'meta accessor' helper... Not sure how that's best to be structured. We should dig into the upstream codebase. Doesn't need to be for this PR though.

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, I don't know where to draw the line in handling cases where an outside program or person has meddled with the labels. If there isn't a label there'll be a CassandraCluster.Status.NodePools[""] NodePoolStatus entry which should give a clue to what's gone wrong.

And if we do some day change the statefulset name format we may and up with multiple sets with the same nodepool label.

I'll leave it like this for now.

Copy link
Contributor

@kragniz kragniz left a comment

Choose a reason for hiding this comment

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

/lgtm

@retest-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to jetstack).
Review the full test history for this PR.
Silence the bot with an /lgtm cancel comment for consistent failures.

@wallrj
Copy link
Member Author

wallrj commented Apr 6, 2018

/lgtm cancel

@jetstack-bot jetstack-bot removed the lgtm label Apr 6, 2018
@wallrj
Copy link
Member Author

wallrj commented Apr 6, 2018

/lgtm

@jetstack-bot
Copy link
Collaborator

@wallrj: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@munnerz
Copy link
Contributor

munnerz commented Apr 6, 2018

/lgtm

@jetstack-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kragniz, munnerz, wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [kragniz,munnerz,wallrj]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wallrj
Copy link
Member Author

wallrj commented Apr 6, 2018

/retest

1 similar comment
@kragniz
Copy link
Contributor

kragniz commented Apr 6, 2018

/retest

@jetstack-bot jetstack-bot merged commit d6a220a into jetstack:master Apr 6, 2018
@wallrj wallrj deleted the 304-use-labels-do-not-parse-names branch April 6, 2018 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants