Merge pull request #5222 from elmiko/capi-cleanup

cleanup unused constants in clusterapi provider
This commit is contained in:
Kubernetes Prow Robot 2022-09-29 15:38:30 -07:00 committed by GitHub
commit 728bea6d4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 25 deletions

View File

@ -581,32 +581,32 @@ func deleteTestConfigs(t *testing.T, controller *machineController, testConfigs
func TestControllerFindMachine(t *testing.T) {
type testCase struct {
description string
name string
namespace string
useDeprecatedAnnotation bool
lookupSucceeds bool
description string
name string
namespace string
useAnnotation bool
lookupSucceeds bool
}
var testCases = []testCase{{
description: "lookup fails",
lookupSucceeds: false,
useDeprecatedAnnotation: false,
name: "machine-does-not-exist",
namespace: "namespace-does-not-exist",
description: "lookup fails",
lookupSucceeds: false,
useAnnotation: false,
name: "machine-does-not-exist",
namespace: "namespace-does-not-exist",
}, {
description: "lookup fails in valid namespace",
lookupSucceeds: false,
useDeprecatedAnnotation: false,
name: "machine-does-not-exist-in-existing-namespace",
description: "lookup fails in valid namespace",
lookupSucceeds: false,
useAnnotation: false,
name: "machine-does-not-exist-in-existing-namespace",
}, {
description: "lookup succeeds",
lookupSucceeds: true,
useDeprecatedAnnotation: false,
description: "lookup succeeds",
lookupSucceeds: true,
useAnnotation: false,
}, {
description: "lookup succeeds with deprecated annotation",
lookupSucceeds: true,
useDeprecatedAnnotation: true,
description: "lookup succeeds with annotation",
lookupSucceeds: true,
useAnnotation: true,
}}
test := func(t *testing.T, tc testCase, testConfig *testConfig) {
@ -644,7 +644,7 @@ func TestControllerFindMachine(t *testing.T) {
if tc.namespace == "" {
tc.namespace = testConfig.machines[0].GetNamespace()
}
if tc.useDeprecatedAnnotation {
if tc.useAnnotation {
for i := range testConfig.machines {
n := testConfig.nodes[i]
annotations := n.GetAnnotations()

View File

@ -28,10 +28,6 @@ import (
)
const (
deprecatedNodeGroupMinSizeAnnotationKey = "cluster.k8s.io/cluster-api-autoscaler-node-group-min-size"
deprecatedNodeGroupMaxSizeAnnotationKey = "cluster.k8s.io/cluster-api-autoscaler-node-group-max-size"
deprecatedClusterNameLabel = "cluster.k8s.io/cluster-name"
cpuKey = "capacity.cluster-autoscaler.kubernetes.io/cpu"
memoryKey = "capacity.cluster-autoscaler.kubernetes.io/memory"
gpuTypeKey = "capacity.cluster-autoscaler.kubernetes.io/gpu-type"