diff --git a/credentialproviderpackage/pkg/configurator/linux/linux.go b/credentialproviderpackage/pkg/configurator/linux/linux.go index c283df4c..fda0bbb9 100644 --- a/credentialproviderpackage/pkg/configurator/linux/linux.go +++ b/credentialproviderpackage/pkg/configurator/linux/linux.go @@ -217,12 +217,6 @@ func (c *linuxOS) createConfig() (string, error) { func (c *linuxOS) updateKubeletArguments(line string) string { args := "" - k8sVersion := os.Getenv("K8S_VERSION") - if semver.Compare(k8sVersion, "v1.26") < 0 { - if !strings.Contains(line, "KubeletCredentialProviders") { - args += " --feature-gates=KubeletCredentialProviders=true" - } - } val, err := c.createConfig() if err != nil { diff --git a/credentialproviderpackage/pkg/configurator/linux/linux_test.go b/credentialproviderpackage/pkg/configurator/linux/linux_test.go index 2b6656c5..136b64e5 100644 --- a/credentialproviderpackage/pkg/configurator/linux/linux_test.go +++ b/credentialproviderpackage/pkg/configurator/linux/linux_test.go @@ -47,8 +47,7 @@ func Test_linuxOS_updateKubeletArguments(t *testing.T) { args: args{line: ""}, outputConfigPath: dir + "/" + credProviderFile, configWantPath: "testdata/expected-config.yaml", - want: fmt.Sprintf(" --feature-gates=KubeletCredentialProviders=true "+ - "--image-credential-provider-config=%s%s", dir, credProviderFile), + want: fmt.Sprintf(" --image-credential-provider-config=%s%s", dir, credProviderFile), }, { name: "test multiple match patterns", @@ -67,27 +66,10 @@ func Test_linuxOS_updateKubeletArguments(t *testing.T) { args: args{line: ""}, outputConfigPath: dir + "/" + credProviderFile, configWantPath: "testdata/expected-config-multiple-patterns.yaml", - want: fmt.Sprintf(" --feature-gates=KubeletCredentialProviders=true "+ - "--image-credential-provider-config=%s%s", dir, credProviderFile), - }, - { - name: "skip credential provider if already provided", - fields: fields{ - profile: "eksa-packages", - extraArgsPath: dir, - basePath: dir, - config: constants.CredentialProviderConfigOptions{ - ImagePatterns: []string{constants.DefaultImagePattern}, - DefaultCacheDuration: constants.DefaultCacheDuration, - }, - }, - args: args{line: " --feature-gates=KubeletCredentialProviders=true"}, - outputConfigPath: dir + "/" + credProviderFile, - configWantPath: "testdata/expected-config.yaml", want: fmt.Sprintf(" --image-credential-provider-config=%s%s", dir, credProviderFile), }, { - name: "skip both cred provider and feature gate if provided", + name: "skip credential provider if already provided", fields: fields{ profile: "eksa-packages", extraArgsPath: dir, @@ -97,7 +79,7 @@ func Test_linuxOS_updateKubeletArguments(t *testing.T) { DefaultCacheDuration: constants.DefaultCacheDuration, }, }, - args: args{line: " --feature-gates=KubeletCredentialProviders=false --image-credential-provider-config=blah"}, + args: args{line: " --image-credential-provider-config=blah"}, outputConfigPath: dir + "/" + credProviderFile, configWantPath: "", want: "", @@ -117,8 +99,7 @@ func Test_linuxOS_updateKubeletArguments(t *testing.T) { outputConfigPath: dir + "/" + credProviderFile, configWantPath: "testdata/expected-config-alpha.yaml", k8sVersion: "v1.25", - want: fmt.Sprintf(" --feature-gates=KubeletCredentialProviders=true "+ - "--image-credential-provider-config=%s%s", dir, credProviderFile), + want: fmt.Sprintf(" --image-credential-provider-config=%s%s", dir, credProviderFile), }, { name: "test v1 api 1.27", @@ -135,8 +116,7 @@ func Test_linuxOS_updateKubeletArguments(t *testing.T) { outputConfigPath: dir + "/" + credProviderFile, configWantPath: "testdata/expected-config.yaml", k8sVersion: "v1.27", - want: fmt.Sprintf(" --feature-gates=KubeletCredentialProviders=true "+ - "--image-credential-provider-config=%s%s", dir, credProviderFile), + want: fmt.Sprintf(" --image-credential-provider-config=%s%s", dir, credProviderFile), }, } for _, tt := range tests {