@@ -29,8 +29,6 @@ import (
29
29
dockertypes "github.com/docker/docker/api/types"
30
30
dockercontainer "github.com/docker/docker/api/types/container"
31
31
32
- utilfeature "k8s.io/apiserver/pkg/util/feature"
33
- kubefeatures "k8s.io/kubernetes/pkg/features"
34
32
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/runtime/v1alpha2"
35
33
"k8s.io/kubernetes/pkg/kubelet/kuberuntime"
36
34
)
@@ -45,10 +43,8 @@ type containerCreationCleanupInfo struct {
45
43
func (ds * dockerService ) applyPlatformSpecificDockerConfig (request * runtimeapi.CreateContainerRequest , createConfig * dockertypes.ContainerCreateConfig ) (* containerCreationCleanupInfo , error ) {
46
44
cleanupInfo := & containerCreationCleanupInfo {}
47
45
48
- if utilfeature .DefaultFeatureGate .Enabled (kubefeatures .WindowsGMSA ) {
49
- if err := applyGMSAConfig (request .GetConfig (), createConfig , cleanupInfo ); err != nil {
50
- return nil , err
51
- }
46
+ if err := applyGMSAConfig (request .GetConfig (), createConfig , cleanupInfo ); err != nil {
47
+ return nil , err
52
48
}
53
49
54
50
return cleanupInfo , nil
@@ -60,7 +56,8 @@ func (ds *dockerService) applyPlatformSpecificDockerConfig(request *runtimeapi.C
60
56
// whose location could potentially change down the line, or even be unknown (eg if docker is not installed on the
61
57
// C: drive)
62
58
// When docker supports passing a credential spec's contents directly, we should switch to using that
63
- // as it will avoid cluttering the registry.
59
+ // as it will avoid cluttering the registry - there is a moby PR out for this:
60
+ // https://github.com/moby/moby/pull/38777
64
61
func applyGMSAConfig (config * runtimeapi.ContainerConfig , createConfig * dockertypes.ContainerCreateConfig , cleanupInfo * containerCreationCleanupInfo ) error {
65
62
credSpec := config .Annotations [kuberuntime .GMSASpecContainerAnnotationKey ]
66
63
if credSpec == "" {
@@ -163,10 +160,8 @@ func randomString(length int) (string, error) {
163
160
// after a container creation. Any errors it returns are simply logged, but do not fail the container
164
161
// creation.
165
162
func (ds * dockerService ) performPlatformSpecificContainerCreationCleanup (cleanupInfo * containerCreationCleanupInfo ) (errors []error ) {
166
- if utilfeature .DefaultFeatureGate .Enabled (kubefeatures .WindowsGMSA ) {
167
- if err := removeGMSARegistryValue (cleanupInfo ); err != nil {
168
- errors = append (errors , err )
169
- }
163
+ if err := removeGMSARegistryValue (cleanupInfo ); err != nil {
164
+ errors = append (errors , err )
170
165
}
171
166
172
167
return
@@ -194,10 +189,7 @@ func removeGMSARegistryValue(cleanupInfo *containerCreationCleanupInfo) error {
194
189
// creating containers.
195
190
// Errors are simply logged, but don't prevent dockershim from starting.
196
191
func (ds * dockerService ) platformSpecificContainerCreationInitCleanup () (errors []error ) {
197
- if utilfeature .DefaultFeatureGate .Enabled (kubefeatures .WindowsGMSA ) {
198
- errors = removeAllGMSARegistryValues ()
199
- }
200
- return
192
+ return removeAllGMSARegistryValues ()
201
193
}
202
194
203
195
func removeAllGMSARegistryValues () (errors []error ) {
0 commit comments