File tree 3 files changed +8
-12
lines changed
pkg/webhook/preflight/nutanix
3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,9 @@ import (
20
20
type Checker struct {
21
21
client ctrlclient.Client
22
22
nutanixClient * prismv4.Client
23
- cluster * clusterv1.Cluster
24
- clusterConfig * variables.ClusterConfigSpec
25
23
}
26
24
27
- func (n * Checker ) Provider () string {
28
- return "nutanix"
29
- }
30
-
31
- func (n * Checker ) Checks (
25
+ func (n * Checker ) Init (
32
26
ctx context.Context ,
33
27
client ctrlclient.Client ,
34
28
cluster * clusterv1.Cluster ,
@@ -54,7 +48,10 @@ func (n *Checker) Checks(
54
48
if clusterConfig .ControlPlane != nil && clusterConfig .ControlPlane .Nutanix != nil {
55
49
checks = append (
56
50
checks ,
57
- n .VMImageCheck (clusterConfig .ControlPlane .Nutanix .MachineDetails , "controlPlane.nutanix.machineDetails" ),
51
+ n .VMImageCheck (
52
+ & clusterConfig .ControlPlane .Nutanix .MachineDetails ,
53
+ "controlPlane.nutanix.machineDetails" ,
54
+ ),
58
55
)
59
56
}
60
57
@@ -79,7 +76,7 @@ func (n *Checker) Checks(
79
76
}
80
77
81
78
n .VMImageCheck (
82
- workerConfig .Nutanix .MachineDetails ,
79
+ & workerConfig .Nutanix .MachineDetails ,
83
80
fmt .Sprintf (
84
81
"workers.machineDeployments[.name=%s].variables.overrides[.name=workerConfig].value.nutanix.machineDetails" ,
85
82
md .Name ,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ func newV4Client(
25
25
error ,
26
26
) {
27
27
if clusterConfig .Nutanix .PrismCentralEndpoint .Credentials .SecretRef .Name == "" {
28
- return nil , fmt .Errorf ("Prism Central credentials reference SecretRef.Name has no value" )
28
+ return nil , fmt .Errorf ("prism Central credentials reference SecretRef.Name has no value" )
29
29
}
30
30
31
31
credentialsSecret := & corev1.Secret {}
@@ -56,6 +56,5 @@ func newV4Client(
56
56
Username : credentials .Username ,
57
57
Password : credentials .Password ,
58
58
Insecure : clusterConfig .Nutanix .PrismCentralEndpoint .Insecure ,
59
- // TODO AdditionalTrustBundle
60
59
})
61
60
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
13
13
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/webhook/preflight"
14
14
)
15
15
16
- func (n * Checker ) VMImageCheck (details carenv1.NutanixMachineDetails , field string ) preflight.Check {
16
+ func (n * Checker ) VMImageCheck (details * carenv1.NutanixMachineDetails , field string ) preflight.Check {
17
17
return func (ctx context.Context ) preflight.CheckResult {
18
18
result := preflight.CheckResult {
19
19
Allowed : true ,
You can’t perform that action at this time.
0 commit comments