-
Notifications
You must be signed in to change notification settings - Fork 1.2k
✨ Allow setting "UseExistingCluster" via environment #223
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
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ichekrygin If they are not already assigned, you can assign the PR to them by writing 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 |
73dc3bc
to
3daf63b
Compare
/kind feature Can you please tag the PR title according to https://github.com/kubernetes-sigs/controller-runtime/blob/master/VERSIONING.md#pr-process ? Thanks! |
We tend to try and favor using structs directly with sane defaults instead of constructors, when possible. Can you make this work with the existing setup? If you need to make a breaking change, now would be the time to do it ;-) |
@DirectXMan12 thank you for looking into this. I think I share the sentiment of using structs directly with sane defaults. In this case, however, the struct The alternative, "constructor-less" solution may look a bit ugly and convoluted (or maybe not): in func UseExistingCluster() bool {
return strings.ToLower(os.Getenv(envUseExistingCluster)) == "true"
} in client code: func TestMain(m *testing.M) {
t := &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "..", "config", "crds")},
UseExistingCluster: envtest.UseExistingCluster(),
}
... @DirectXMan12 would you be open to "contsturctor" like solion? If so - I will update the PR with... |
So, the other option is changing |
I think I am coming to a realization that this is best handled in each individual project, rather than being built in. Closing. |
Update GitBook release instructions
This PR is an attempt to address feature request: #222
Non-breaking feature: sparkles (:sparkles:)