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

make lease label and lease namespace configurable #670

Conversation

ipochi
Copy link
Contributor

@ipochi ipochi commented Oct 25, 2024

Currently the lease controller system has hard coded values for lease namespace and lease labels.
This PR adds cli flags to make those values configurable.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 25, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 25, 2024
@@ -321,6 +330,13 @@ func (o *ProxyRunOptions) Validate() error {
}
}
}
// Validate labels provided.
if o.EnableLeaseController {
_, err := util.ParseLabels(o.LeaseLabel)
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than parsing the labels more than once, would it make sense to store the result of the parsed label at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't want to pollute the ProxyRunOptions struct with another label field, especially we are using once in validate and once to setup the server.

@cheftako
Copy link
Contributor

Nice change. I would like to see the Split vs SplitN change. The rest we can treat as feature requests.

@ipochi
Copy link
Contributor Author

ipochi commented Nov 7, 2024

/approve

@ipochi
Copy link
Contributor Author

ipochi commented Nov 11, 2024

@cheftako I believe this is good to get merged.

@ipochi ipochi changed the title make lease label and lease namesapce configurable make lease label and lease namespace configurable Nov 13, 2024
},
shouldError: false,
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to have a test case like "foo=var=baz"

@cheftako
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, ipochi

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:

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 merged commit 23b100b into kubernetes-sigs:master Nov 13, 2024
22 checks passed
@ipochi ipochi deleted the imran/make-lease-controller-configurable branch November 14, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants