Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Rename leader election config fields #2637

Closed
wants to merge 1 commit into from

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Jan 5, 2024

Changing the manager.Options and leaderelection.Options field names around leader election configuration to be more explanatory and reflective of what they actually do.

  • LeaderElectionNamespace -> LeaderElectionLockNamespace since it actually is the namespace for the lock.

  • LeaderElectionID -> LeaderElectionLockName since it actually is the resource name of the lock.

  • Also updated pkg/leaderelection to remove stuttering in the field names since the type is already leaderelection.Options and there is no need to repeat the LeaderElection prefix.

Closes #2636.

Change the names of the leader election config fields to be more
explanatory and reflective of what they actually do:

- `LeaderElectionNamespace` -> `LeaderElectionLockNamespace` since
  it actually is the namespace for the lock.

- `LeaderElectionID` -> `LeaderElectionLockName` since it actually
  is the resource name of the lock.

- Also updated `pkg/leaderelection` to remove stuttering in the field
  names since the type is already `leaderelection.Options` and no
  need to repeat the `LeaderElection` prefix.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 5, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ahmetb
Once this PR has been reviewed and has the lgtm label, please assign fillzpp for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 5, 2024
@k8s-ci-robot
Copy link
Contributor

@ahmetb: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-controller-runtime-apidiff 4b954bd link false /test pull-controller-runtime-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@troy0820
Copy link
Member

troy0820 commented Jan 5, 2024

Failing api-diff, unsure how to deal with removals and utilize this tool to not flag what is being renamed. @joelanford 👀

@ahmetb
Copy link
Member Author

ahmetb commented Jan 5, 2024

Peeked at old PRs #2407 #2199 that also did similar changes, they also had the failure at the time of merging. I think that failure is largely informational.

// LeaderElectionNamespace determines the namespace in which the leader
// election resource will be created.
LeaderElectionNamespace string
// LeaderElectionLockNamespace determines the namespace of the leader election lock
Copy link
Member

Choose a reason for hiding this comment

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

While I do agree that the new names are better, renaming these will result in a lot of churn for consumers, I am not sure if that is worth it

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 totally valid. It doesn't offer any net new improvement.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed with @alvaroaleman.

If we think the name change really is worth it, we could introduce the new fields, deprecate the old ones, and then go a few minor releases before deleting the old ones. Still churn, but gives folks warning/time. That would bring its own complexity in the interim though (multiple fields that do the same thing, coding for mutual exclusivity, etc.)

Copy link
Member

Choose a reason for hiding this comment

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

Would leaving a comment in the docs for this be better? I don't see this getting merged being that the churn associated with this and the complexity @joelanford mentioned with trying to promote these fields and deprecating others would help either.

Copy link
Member

Choose a reason for hiding this comment

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

To echo other's comments, given that the field are self explanatory, maybe not 100% accurate I guess (for historical reasons these have changed the internal meaning); could we add more information on the comment, rather than renaming them?

@troy0820
Copy link
Member

troy0820 commented Jan 7, 2024

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 7, 2024
@joelanford
Copy link
Member

Failing api-diff, unsure how to deal with removals and utilize this tool to not flag what is being renamed. @joelanford 👀

Yes, this is just an informational test that helps us ensure we avoid accidental API breakage. A failure for intentional API breakage does not block merge.

@ahmetb
Copy link
Member Author

ahmetb commented Feb 7, 2024

Closing based on the decision on the proposal.
/close

@k8s-ci-robot
Copy link
Contributor

@ahmetb: Closed this PR.

In response to this:

Closing based on the decision on the proposal.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Naming consistency for leader election lock options
6 participants