mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-02 23:55:18 +00:00
client-go/features: warn when ordering initialization issue
ReplaceFeatureGates logs a warning when the default env var implementation has been already used. Such a situation indicates a potential ordering issue and usually is unwanted. Kubernetes-commit: 04bbd3481f70825eea54b4b154a04d2496dcf652
This commit is contained in:
committed by
Kubernetes Publisher
parent
ca4f3a73f7
commit
e8a81a3a43
@@ -146,3 +146,11 @@ func TestEnvVarFeatureGatesEnabledPanic(t *testing.T) {
|
||||
target := newEnvVarFeatureGates(nil)
|
||||
require.PanicsWithError(t, fmt.Errorf("feature %q is not registered in FeatureGates %q", "UnknownFeature", target.callSiteName).Error(), func() { target.Enabled("UnknownFeature") })
|
||||
}
|
||||
|
||||
func TestHasAlreadyReadEnvVar(t *testing.T) {
|
||||
target := newEnvVarFeatureGates(nil)
|
||||
require.False(t, target.hasAlreadyReadEnvVar())
|
||||
|
||||
_ = target.getEnabledMapFromEnvVar()
|
||||
require.True(t, target.hasAlreadyReadEnvVar())
|
||||
}
|
||||
|
Reference in New Issue
Block a user