fix cloud-node-manager stub

This commit is contained in:
Malte Poll 2022-03-29 13:21:47 +02:00 committed by Malte Poll
parent f04765dab5
commit efdd88459b

View File

@ -40,7 +40,6 @@ func TestInitCluster(t *testing.T) {
SupportsCloudControllerManager: false,
SupportClusterAutoscaler: false,
AutoscalingNodeGroups: []string{"someNodeGroup"},
CloudControllerManagerEnv: []k8s.EnvVar{},
},
expectErr: false,
},
@ -62,7 +61,6 @@ func TestInitCluster(t *testing.T) {
ProviderID: "fake://providerid",
SupportsCloudControllerManager: false,
SupportClusterAutoscaler: false,
CloudControllerManagerEnv: []k8s.EnvVar{},
},
expectErr: false,
},
@ -93,7 +91,6 @@ func TestInitCluster(t *testing.T) {
SupportClusterAutoscaler: true,
AutoscalingCloudprovider: "some-name",
AutoscalingNodeGroups: []string{"someNodeGroup"},
CloudControllerManagerEnv: []k8s.EnvVar{},
},
expectErr: false,
},
@ -116,7 +113,6 @@ func TestInitCluster(t *testing.T) {
CloudControllerManagerName: "some-name",
CloudControllerManagerImage: "someImage",
CloudControllerManagerPath: "/some/path",
CloudControllerManagerEnv: []k8s.EnvVar{},
},
expectErr: false,
},
@ -148,7 +144,6 @@ func TestInitCluster(t *testing.T) {
expectedInitClusterInput: kubernetes.InitClusterInput{
APIServerAdvertiseIP: "10.118.0.1",
NodeIP: "10.118.0.1",
CloudControllerManagerEnv: []k8s.EnvVar{},
},
},
"getting kubeconfig fail detected": {
@ -389,6 +384,7 @@ type stubCloudControllerManager struct {
secretsErr error
volumesRes []k8s.Volume
volumeMountRes []k8s.VolumeMount
envRes []k8s.EnvVar
supportedRes bool
prepareInstanceRequests []prepareInstanceRequest
@ -435,7 +431,7 @@ func (s *stubCloudControllerManager) VolumeMounts() []k8s.VolumeMount {
}
func (s *stubCloudControllerManager) Env() []k8s.EnvVar {
return []k8s.EnvVar{}
return s.envRes
}
func (s *stubCloudControllerManager) Supported() bool {
@ -445,18 +441,8 @@ func (s *stubCloudControllerManager) Supported() bool {
type stubCloudNodeManager struct {
imageRes string
pathRes string
nameRes string
prepareInstanceRes error
extraArgsRes []string
configMapsRes resources.ConfigMaps
configMapsErr error
secretsRes resources.Secrets
secretsErr error
volumesRes []k8s.Volume
volumeMountRes []k8s.VolumeMount
supportedRes bool
prepareInstanceRequests []prepareInstanceRequest
}
func (s *stubCloudNodeManager) Image() string {