-
Notifications
You must be signed in to change notification settings - Fork 98
fix: lazy featuregate init in callers #704
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
755e43b to
fbcf905
Compare
Signed-off-by: Eric Stroczynski <[email protected]>
fbcf905 to
665653d
Compare
|
Instantiating the feature gate singleton only if there's actually a consumer: appears to be a tidy approach. @estroz you tested that this actually fixes #702 for you, right? We have identified an invariant here that want to maintain. Hence, we may want to add a pragmatic test to make sure that we don't regress from here. We can do that in another PR. |
|
There was a desire in the initial design to not have to call a function, but rather just access a global variable from the featuregate package (similar to as is done in k8s proper). I'm not 100% opposed to this approach, but I would want to then remove the global |
Signed-off-by: Eric Stroczynski <[email protected]>
|
I think we can still get away with having FeatureGates be a global variable instead of a function. We just need to implement its methods on its pointer type and init it with the once iff the incoming pointer is nil and equals the address of the global FeatureGates variable. |
|
@klueska that won't work because packages importing and using |
|
Sorry for the delay on this. Between vacation and conferences we've let this PR sit open much longer than it should have. Given the following, I'd say let's go ahead and merge this as is -- if we think of a way around this in the future we can implement it, but it's not worth blocking this PR any further:
|
|
/ok to test 45967ec |
|
/cherry-pick release-25.8 |
|
🤖 Backport PR created for |
Fixes #702