File tree 4 files changed +8
-25
lines changed
4 files changed +8
-25
lines changed Original file line number Diff line number Diff line change @@ -10,30 +10,23 @@ import (
10
10
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers"
11
11
nutanixclusterconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/clusterconfig"
12
12
nutanixmutation "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/mutation"
13
- "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/mutation/controlplaneendpoint"
14
13
nutanixworkerconfig "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/nutanix/workerconfig"
15
14
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options"
16
15
)
17
16
18
- type Handlers struct {
19
- nutanixControlPlaneEndpointConfig * controlplaneendpoint.Config
20
- }
17
+ type Handlers struct {}
21
18
22
19
func New (
23
- globalOptions * options.GlobalOptions ,
20
+ _ * options.GlobalOptions ,
24
21
) * Handlers {
25
- return & Handlers {
26
- nutanixControlPlaneEndpointConfig : & controlplaneendpoint.Config {
27
- GlobalOptions : globalOptions ,
28
- },
29
- }
22
+ return & Handlers {}
30
23
}
31
24
32
25
func (h * Handlers ) AllHandlers (mgr manager.Manager ) []handlers.Named {
33
26
return []handlers.Named {
34
27
nutanixclusterconfig .NewVariable (),
35
28
nutanixworkerconfig .NewVariable (),
36
- nutanixmutation .MetaPatchHandler (mgr , h . nutanixControlPlaneEndpointConfig ),
29
+ nutanixmutation .MetaPatchHandler (mgr ),
37
30
nutanixmutation .MetaWorkerPatchHandler (mgr ),
38
31
}
39
32
}
Original file line number Diff line number Diff line change @@ -22,41 +22,31 @@ import (
22
22
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/patches/selectors"
23
23
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
24
24
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/clusterconfig"
25
- "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/options"
26
25
)
27
26
28
27
const (
29
28
// VariableName is the external patch variable name.
30
29
VariableName = "controlPlaneEndpoint"
31
30
)
32
31
33
- type Config struct {
34
- * options.GlobalOptions
35
- }
36
-
37
32
type nutanixControlPlaneEndpoint struct {
38
- config * Config
39
-
40
33
variableName string
41
34
variableFieldPath []string
42
35
}
43
36
44
- func NewPatch (cfg * Config ) * nutanixControlPlaneEndpoint {
37
+ func NewPatch () * nutanixControlPlaneEndpoint {
45
38
return newNutanixControlPlaneEndpoint (
46
- cfg ,
47
39
clusterconfig .MetaVariableName ,
48
40
v1alpha1 .NutanixVariableName ,
49
41
VariableName ,
50
42
)
51
43
}
52
44
53
45
func newNutanixControlPlaneEndpoint (
54
- cfg * Config ,
55
46
variableName string ,
56
47
variableFieldPath ... string ,
57
48
) * nutanixControlPlaneEndpoint {
58
49
return & nutanixControlPlaneEndpoint {
59
- config : cfg ,
60
50
variableName : variableName ,
61
51
variableFieldPath : variableFieldPath ,
62
52
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ func TestControlPlaneEndpointPatch(t *testing.T) {
26
26
27
27
var _ = Describe ("Generate Nutanix ControlPlane endpoint patches" , func () {
28
28
patchGenerator := func () mutation.GeneratePatches {
29
- return mutation .NewMetaGeneratePatchesHandler ("" , helpers .TestEnv .Client , NewPatch (nil )).(mutation.GeneratePatches )
29
+ return mutation .NewMetaGeneratePatchesHandler ("" , helpers .TestEnv .Client , NewPatch ()).(mutation.GeneratePatches )
30
30
}
31
31
32
32
testDefs := []capitest.PatchTestDef {
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ import (
15
15
)
16
16
17
17
// MetaPatchHandler returns a meta patch handler for mutating CAPX clusters.
18
- func MetaPatchHandler (mgr manager.Manager , cfg * controlplaneendpoint. Config ) handlers.Named {
18
+ func MetaPatchHandler (mgr manager.Manager ) handlers.Named {
19
19
patchHandlers := append (
20
20
[]mutation.MetaMutator {
21
- controlplaneendpoint .NewPatch (cfg ),
21
+ controlplaneendpoint .NewPatch (),
22
22
prismcentralendpoint .NewPatch (),
23
23
machinedetails .NewControlPlanePatch (),
24
24
},
You can’t perform that action at this time.
0 commit comments