Skip to content

Commit 8f12921

Browse files
committed
refactor: move aggregate types to api/ module
1 parent 7ccc23b commit 8f12921

File tree

102 files changed

+230
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+230
-333
lines changed

api/v1alpha1/constants.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,27 @@
44
package v1alpha1
55

66
const (
7+
// ClusterConfigVariableName is the meta cluster config patch variable name.
8+
ClusterConfigVariableName = "clusterConfig"
9+
// ControlPlaneConfigVariableName is the control-plane config patch variable name.
10+
ControlPlaneConfigVariableName = "controlPlane"
11+
// WorkerConfigVariableName is the meta worker config patch variable name.
12+
WorkerConfigVariableName = "workerConfig"
13+
14+
// AWSVariableName is the AWS config patch variable name.
15+
AWSVariableName = "aws"
16+
// DockerVariableName is the Docker config patch variable name.
17+
DockerVariableName = "docker"
18+
// NutanixVariableName is the Nutanix config patch variable name.
19+
NutanixVariableName = "nutanix"
20+
721
// CNIVariableName is the CNI external patch variable name.
822
CNIVariableName = "cni"
923
// NFDVariableName is the NFD external patch variable name.
1024
NFDVariableName = "nfd"
25+
1126
// ClusterAutoscalerVariableName is the cluster-autoscaler external patch variable name.
1227
ClusterAutoscalerVariableName = "clusterAutoscaler"
13-
// AWSVariableName is the AWS config patch variable name.
14-
AWSVariableName = "aws"
15-
// NutanixVariableName is the Nutanix config patch variable name.
16-
NutanixVariableName = "nutanix"
17-
// ServiceLoadBalancerName is the Service LoadBalancer config patch variable name.
28+
// ServiceLoadBalancerVariableName is the Service LoadBalancer config patch variable name.
1829
ServiceLoadBalancerVariableName = "serviceLoadBalancer"
1930
)

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
// Copyright 2024 Nutanix. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
package clusterconfig
4+
package variables
55

66
import carenv1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
77

8-
// ClusterConfig is a type to be used internally to simplify the handling of cluster configurations for different
8+
// The types here are to be used internally to simplify the handling of cluster configurations for different
99
// providers. It is not meant to be used as a CRD.
1010
// By including all the possible configurations for all the providers, we can easily switch between providers in code
1111
// without type assertions/switches and avoids passing around `interface{}` or `any` types.
1212
// Every provider-specific cluster config variable will successfully unmarshal to this type and so it is safe to use
1313
// this internally when a handler provides functionality for multiple providers but exhibits different behaviour per
1414
// provider.
15-
type ClusterConfig struct {
15+
16+
type ClusterConfigSpec struct {
1617
AWS *carenv1.AWSSpec `json:"aws,omitempty"`
1718

1819
Docker *carenv1.DockerSpec `json:"docker,omitempty"`
@@ -21,15 +22,23 @@ type ClusterConfig struct {
2122

2223
carenv1.GenericClusterConfigSpec `json:",inline"`
2324

24-
ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
25+
ControlPlane *ControlPlaneNodeConfigSpec `json:"controlPlane,omitempty"`
2526

26-
ControlPlane *ControlPlaneConfig `json:"controlPlane,omitempty"`
27+
ExtraAPIServerCertSANs []string `json:"extraAPIServerCertSANs,omitempty"`
2728
}
2829

29-
type ControlPlaneConfig struct {
30+
type ControlPlaneNodeConfigSpec struct {
3031
AWS *carenv1.AWSControlPlaneNodeSpec `json:"aws,omitempty"`
3132

32-
Docker *carenv1.DockerNodeConfigSpec `json:"docker,omitempty"`
33+
Docker *carenv1.DockerNodeSpec `json:"docker,omitempty"`
34+
35+
Nutanix *carenv1.NutanixNodeSpec `json:"nutanix,omitempty"`
36+
}
37+
38+
type WorkerNodeConfigSpec struct {
39+
AWS *carenv1.AWSWorkerNodeSpec `json:"aws,omitempty"`
40+
41+
Docker *carenv1.DockerNodeSpec `json:"docker,omitempty"`
3342

34-
Nutanix *carenv1.NutanixNodeConfigSpec `json:"nutanix,omitempty"`
43+
Nutanix *carenv1.NutanixNodeSpec `json:"nutanix,omitempty"`
3544
}

pkg/handlers/aws/clusterconfig/variables.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
1313
commonhandlers "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers"
1414
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
15-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1615
)
1716

1817
var (
@@ -41,7 +40,7 @@ func (h *awsClusterConfigVariableHandler) DiscoverVariables(
4140
resp *runtimehooksv1.DiscoverVariablesResponse,
4241
) {
4342
resp.Variables = append(resp.Variables, clusterv1.ClusterClassVariable{
44-
Name: clusterconfig.MetaVariableName,
43+
Name: v1alpha1.ClusterConfigVariableName,
4544
Required: true,
4645
Schema: v1alpha1.AWSClusterConfig{}.VariableSchema(),
4746
})

pkg/handlers/aws/mutation/ami/inject_control_plane.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import (
77
capav1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
88
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
99
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
10-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1110
)
1211

1312
func NewControlPlanePatch() *awsAMISpecPatchHandler {
1413
return newAWSAMISpecPatchHandler(
15-
clusterconfig.MetaVariableName,
14+
v1alpha1.ClusterConfigVariableName,
1615
[]string{
17-
clusterconfig.MetaControlPlaneConfigName,
16+
v1alpha1.ControlPlaneConfigVariableName,
1817
v1alpha1.AWSVariableName,
1918
VariableName,
2019
},

pkg/handlers/aws/mutation/ami/inject_control_plane_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
1313
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1414
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
15-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1615
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/test/helpers"
1716
)
1817

@@ -29,9 +28,9 @@ var _ = Describe("Generate AMI patches for ControlPlane", func() {
2928
Name: "AMI set for control plane",
3029
Vars: []runtimehooksv1.Variable{
3130
capitest.VariableWithValue(
32-
clusterconfig.MetaVariableName,
31+
v1alpha1.ClusterConfigVariableName,
3332
v1alpha1.AMISpec{ID: "ami-controlplane"},
34-
clusterconfig.MetaControlPlaneConfigName,
33+
v1alpha1.ControlPlaneConfigVariableName,
3534
v1alpha1.AWSVariableName,
3635
VariableName,
3736
),
@@ -49,15 +48,15 @@ var _ = Describe("Generate AMI patches for ControlPlane", func() {
4948
Name: "AMI lookup format set for control plane",
5049
Vars: []runtimehooksv1.Variable{
5150
capitest.VariableWithValue(
52-
clusterconfig.MetaVariableName,
51+
v1alpha1.ClusterConfigVariableName,
5352
v1alpha1.AMISpec{
5453
Lookup: &v1alpha1.AMILookup{
5554
Format: "test-{{.kubernetesVersion}}-format",
5655
Org: "1234",
5756
BaseOS: "testOS",
5857
},
5958
},
60-
clusterconfig.MetaControlPlaneConfigName,
59+
v1alpha1.ControlPlaneConfigVariableName,
6160
v1alpha1.AWSVariableName,
6261
VariableName,
6362
),

pkg/handlers/aws/mutation/ami/inject_worker.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import (
66
capav1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
77
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
88
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
9-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/workerconfig"
109
)
1110

1211
func NewWorkerPatch() *awsAMISpecPatchHandler {
1312
return newAWSAMISpecPatchHandler(
14-
workerconfig.MetaVariableName,
13+
v1alpha1.WorkerConfigVariableName,
1514
[]string{
1615
v1alpha1.AWSVariableName,
1716
VariableName,

pkg/handlers/aws/mutation/ami/inject_worker_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
1414
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1515
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
16-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/workerconfig"
1716
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/test/helpers"
1817
)
1918

@@ -27,7 +26,7 @@ var _ = Describe("Generate AMI patches for Worker", func() {
2726
Name: "AMI set for workers",
2827
Vars: []runtimehooksv1.Variable{
2928
capitest.VariableWithValue(
30-
workerconfig.MetaVariableName,
29+
v1alpha1.WorkerConfigVariableName,
3130
v1alpha1.AMISpec{ID: "ami-controlplane"},
3231
v1alpha1.AWSVariableName,
3332
VariableName,
@@ -52,7 +51,7 @@ var _ = Describe("Generate AMI patches for Worker", func() {
5251
Name: "AMI lookup format set for worker",
5352
Vars: []runtimehooksv1.Variable{
5453
capitest.VariableWithValue(
55-
workerconfig.MetaVariableName,
54+
v1alpha1.WorkerConfigVariableName,
5655
v1alpha1.AMISpec{
5756
Lookup: &v1alpha1.AMILookup{
5857
Format: "test-{{.kubernetesVersion}}-format",

pkg/handlers/aws/mutation/ami/variables_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import (
1111
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1313
awsclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/clusterconfig"
14-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1514
)
1615

1716
func TestVariableValidation(t *testing.T) {
1817
capitest.ValidateDiscoverVariables(
1918
t,
20-
clusterconfig.MetaVariableName,
19+
v1alpha1.ClusterConfigVariableName,
2120
ptr.To(v1alpha1.AWSClusterConfig{}.VariableSchema()),
2221
true,
2322
awsclusterconfig.NewVariable,

pkg/handlers/aws/mutation/cni/calico/inject.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches"
2121
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
2222
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
23-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
2423
)
2524

2625
const (
@@ -35,7 +34,7 @@ type calicoPatchHandler struct {
3534

3635
func NewPatch() *calicoPatchHandler {
3736
return newCalicoPatchHandler(
38-
clusterconfig.MetaVariableName,
37+
v1alpha1.ClusterConfigVariableName,
3938
"addons",
4039
v1alpha1.CNIVariableName,
4140
)

pkg/handlers/aws/mutation/cni/calico/inject_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
1616
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1717
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
18-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1918
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/test/helpers"
2019
)
2120

@@ -37,7 +36,7 @@ var _ = Describe("Generate AWS Calico CNI ingress patches", func() {
3736
Name: "provider set with AWSClusterTemplate",
3837
Vars: []runtimehooksv1.Variable{
3938
capitest.VariableWithValue(
40-
clusterconfig.MetaVariableName,
39+
v1alpha1.ClusterConfigVariableName,
4140
v1alpha1.CNI{
4241
Provider: v1alpha1.CNIProviderCalico,
4342
},
@@ -105,7 +104,7 @@ var _ = Describe("Generate AWS Calico CNI ingress patches", func() {
105104
Name: "provider set with AWSClusterTemplate pre-existing rules",
106105
Vars: []runtimehooksv1.Variable{
107106
capitest.VariableWithValue(
108-
clusterconfig.MetaVariableName,
107+
v1alpha1.ClusterConfigVariableName,
109108
v1alpha1.CNI{
110109
Provider: v1alpha1.CNIProviderCalico,
111110
},
@@ -198,7 +197,7 @@ var _ = Describe("Generate AWS Calico CNI ingress patches", func() {
198197
Name: "provider set with AWSClusterTemplate conflicting pre-existing rules",
199198
Vars: []runtimehooksv1.Variable{
200199
capitest.VariableWithValue(
201-
clusterconfig.MetaVariableName,
200+
v1alpha1.ClusterConfigVariableName,
202201
v1alpha1.CNI{
203202
Provider: v1alpha1.CNIProviderCalico,
204203
},

pkg/handlers/aws/mutation/controlplaneloadbalancer/inject.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches"
1919
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
2020
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
21-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
2221
)
2322

2423
const (
@@ -33,7 +32,7 @@ type awsControlPlaneLoadBalancer struct {
3332

3433
func NewPatch() *awsControlPlaneLoadBalancer {
3534
return newAWSControlPlaneLoadBalancer(
36-
clusterconfig.MetaVariableName,
35+
v1alpha1.ClusterConfigVariableName,
3736
v1alpha1.AWSVariableName,
3837
VariableName,
3938
)

pkg/handlers/aws/mutation/controlplaneloadbalancer/inject_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
1616
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1717
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
18-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1918
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/test/helpers"
2019
)
2120

@@ -37,7 +36,7 @@ var _ = Describe("Generate AWS ControlPlane LoadBalancer patches", func() {
3736
Name: "ControlPlaneLoadBalancer scheme set to internet-facing",
3837
Vars: []runtimehooksv1.Variable{
3938
capitest.VariableWithValue(
40-
clusterconfig.MetaVariableName,
39+
v1alpha1.ClusterConfigVariableName,
4140
v1alpha1.AWSLoadBalancerSpec{
4241
Scheme: &capav1.ELBSchemeInternetFacing,
4342
},
@@ -58,7 +57,7 @@ var _ = Describe("Generate AWS ControlPlane LoadBalancer patches", func() {
5857
Name: "ControlPlaneLoadBalancer scheme set to internal",
5958
Vars: []runtimehooksv1.Variable{
6059
capitest.VariableWithValue(
61-
clusterconfig.MetaVariableName,
60+
v1alpha1.ClusterConfigVariableName,
6261
v1alpha1.AWSLoadBalancerSpec{
6362
Scheme: &capav1.ELBSchemeInternal,
6463
},

pkg/handlers/aws/mutation/controlplaneloadbalancer/variables_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ import (
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
1313
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1414
awsclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws/clusterconfig"
15-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1615
)
1716

1817
func TestVariableValidation(t *testing.T) {
1918
capitest.ValidateDiscoverVariables(
2019
t,
21-
clusterconfig.MetaVariableName,
20+
v1alpha1.ClusterConfigVariableName,
2221
ptr.To(v1alpha1.AWSClusterConfig{}.VariableSchema()),
2322
true,
2423
awsclusterconfig.NewVariable,

pkg/handlers/aws/mutation/iaminstanceprofile/inject_control_plane.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches"
1919
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
2020
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
21-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
2221
)
2322

2423
const (
@@ -33,8 +32,8 @@ type awsIAMInstanceProfileControlPlanePatchHandler struct {
3332

3433
func NewControlPlanePatch() *awsIAMInstanceProfileControlPlanePatchHandler {
3534
return newAWSIAMInstanceProfileControlPlanePatchHandler(
36-
clusterconfig.MetaVariableName,
37-
clusterconfig.MetaControlPlaneConfigName,
35+
v1alpha1.ClusterConfigVariableName,
36+
v1alpha1.ControlPlaneConfigVariableName,
3837
v1alpha1.AWSVariableName,
3938
VariableName,
4039
)

pkg/handlers/aws/mutation/iaminstanceprofile/inject_control_plane_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers/mutation"
1313
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest"
1414
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/testutils/capitest/request"
15-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
1615
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/test/helpers"
1716
)
1817

@@ -33,9 +32,9 @@ var _ = Describe("Generate IAMInstanceProfile patches for ControlPlane", func()
3332
Name: "iamInstanceProfile for control plane set",
3433
Vars: []runtimehooksv1.Variable{
3534
capitest.VariableWithValue(
36-
clusterconfig.MetaVariableName,
35+
v1alpha1.ClusterConfigVariableName,
3736
"control-plane.cluster-api-provider-aws.sigs.k8s.io",
38-
clusterconfig.MetaControlPlaneConfigName,
37+
v1alpha1.ControlPlaneConfigVariableName,
3938
v1alpha1.AWSVariableName,
4039
VariableName,
4140
),

pkg/handlers/aws/mutation/iaminstanceprofile/inject_worker.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches"
1919
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
2020
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
21-
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/workerconfig"
2221
)
2322

2423
type awsIAMInstanceProfileWorkerPatchHandler struct {
@@ -28,7 +27,7 @@ type awsIAMInstanceProfileWorkerPatchHandler struct {
2827

2928
func NewWorkerPatch() *awsIAMInstanceProfileWorkerPatchHandler {
3029
return newAWSIAMInstanceProfileWorkerPatchHandler(
31-
workerconfig.MetaVariableName,
30+
v1alpha1.WorkerConfigVariableName,
3231
v1alpha1.AWSVariableName,
3332
VariableName,
3433
)

0 commit comments

Comments
 (0)