Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup unused constants in clusterapi provider #5222

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down