File tree 9 files changed +49
-12
lines changed
examples/capi-quick-start
hack/examples/base/nutanix/cluster-topology
pkg/handlers/nutanix/mutation
9 files changed +49
-12
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,11 @@ func (NutanixSpec) VariableSchema() clusterv1.VariableSchema {
28
28
}
29
29
30
30
type NutanixPrismCentralEndpointSpec struct {
31
- Host string `json:"host,omitempty "`
32
- Port int32 `json:"port,omitempty "`
33
- Insecure bool `json:"insecure,omitempty "`
31
+ Host string `json:"host"`
32
+ Port int32 `json:"port"`
33
+ Insecure bool `json:"insecure"`
34
34
AdditionalTrustBundle string `json:"additionalTrustBundle,omitempty"`
35
+ CredentialSecret string `json:"credentialSecret"`
35
36
}
36
37
37
38
func (NutanixPrismCentralEndpointSpec ) VariableSchema () clusterv1.VariableSchema {
@@ -53,7 +54,11 @@ func (NutanixPrismCentralEndpointSpec) VariableSchema() clusterv1.VariableSchema
53
54
Type : "boolean" ,
54
55
},
55
56
"additionalTrustBundle" : {
56
- Description : "Certificate trust bundle used for Prism Central connection" ,
57
+ Description : "Name of configMap with certificate trust bundle used for Prism Central connection" ,
58
+ Type : "string" ,
59
+ },
60
+ "credentialSecret" : {
61
+ Description : "Name of a Credential information secret for the target Prism instance" ,
57
62
Type : "string" ,
58
63
},
59
64
},
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ spec:
335
335
host : ${CONTROL_PLANE_ENDPOINT_IP}
336
336
port : ${CONTROL_PLANE_ENDPOINT_PORT}
337
337
prismCentralEndpoint :
338
- additionalTrustBundle : trust-bundle-root -ca
338
+ additionalTrustBundle : ${CLUSTER_NAME}-pc-trusted -ca-bundle
339
339
credentialSecret : ${CLUSTER_NAME}-pc-creds
340
340
host : ${NUTANIX_ENDPOINT}
341
341
insecure : ${NUTANIX_INSECURE}
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ spec:
335
335
host : ${CONTROL_PLANE_ENDPOINT_IP}
336
336
port : ${CONTROL_PLANE_ENDPOINT_PORT}
337
337
prismCentralEndpoint :
338
- additionalTrustBundle : trust-bundle-root -ca
338
+ additionalTrustBundle : ${CLUSTER_NAME}-pc-trusted -ca-bundle
339
339
credentialSecret : ${CLUSTER_NAME}-pc-creds
340
340
host : ${NUTANIX_ENDPOINT}
341
341
insecure : ${NUTANIX_INSECURE}
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ spec:
335
335
host : ${CONTROL_PLANE_ENDPOINT_IP}
336
336
port : ${CONTROL_PLANE_ENDPOINT_PORT}
337
337
prismCentralEndpoint :
338
- additionalTrustBundle : trust-bundle-root -ca
338
+ additionalTrustBundle : ${CLUSTER_NAME}-pc-trusted -ca-bundle
339
339
credentialSecret : ${CLUSTER_NAME}-pc-creds
340
340
host : ${NUTANIX_ENDPOINT}
341
341
insecure : ${NUTANIX_INSECURE}
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ spec:
335
335
host : ${CONTROL_PLANE_ENDPOINT_IP}
336
336
port : ${CONTROL_PLANE_ENDPOINT_PORT}
337
337
prismCentralEndpoint :
338
- additionalTrustBundle : trust-bundle-root -ca
338
+ additionalTrustBundle : ${CLUSTER_NAME}-pc-trusted -ca-bundle
339
339
credentialSecret : ${CLUSTER_NAME}-pc-creds
340
340
host : ${NUTANIX_ENDPOINT}
341
341
insecure : ${NUTANIX_INSECURE}
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ patches:
59
59
host: $${CONTROL_PLANE_ENDPOINT_IP}
60
60
port: $${CONTROL_PLANE_ENDPOINT_PORT}
61
61
prismCentralEndpoint:
62
- additionalTrustBundle: trust-bundle-root -ca
62
+ additionalTrustBundle: $${CLUSTER_NAME}-pc-trusted -ca-bundle
63
63
host: $${NUTANIX_ENDPOINT}
64
64
insecure: $${NUTANIX_INSECURE}
65
65
port: 9440
Original file line number Diff line number Diff line change @@ -127,8 +127,20 @@ func (h *nutanixMachineDetailsControlPlanePatchHandler) Mutate(
127
127
obj .Spec .Template .Spec .SystemDiskSize = resource .MustParse (
128
128
nutanixMachineDetailsVar .SystemDiskSize ,
129
129
)
130
+
131
+ subnets := make ([]capxv1.NutanixResourceIdentifier , len (nutanixMachineDetailsVar .Subnets ))
132
+ for _ , subnetCRE := range nutanixMachineDetailsVar .Subnets {
133
+ subnet := capxv1.NutanixResourceIdentifier {Type : capxv1 .NutanixIdentifierType (subnetCRE .Type )}
134
+ if subnetCRE .Type == v1alpha1 .NutanixIdentifierName {
135
+ subnet .Name = subnetCRE .Name
136
+ } else {
137
+ subnet .UUID = subnetCRE .UUID
138
+ }
139
+ subnets = append (subnets , subnet )
140
+ }
141
+
142
+ obj .Spec .Template .Spec .Subnets = subnets
130
143
// TODO
131
- // obj.Spec.Template.Spec.Subnets = nutanixMachineDetailsVar.Subnets
132
144
// obj.Spec.Template.Spec.Project = nutanixMachineDetailsVar.Project
133
145
// obj.Spec.Template.Spec.AdditionalCategories = nutanixMachineDetailsVar.AdditionalCategories
134
146
// obj.Spec.Template.Spec.GPUs = nutanixMachineDetailsVar.GPUs
Original file line number Diff line number Diff line change @@ -121,8 +121,20 @@ func (h *nutanixMachineDetailsWorkerPatchHandler) Mutate(
121
121
obj .Spec .Template .Spec .SystemDiskSize = resource .MustParse (
122
122
nutanixMachineDetailsVar .SystemDiskSize ,
123
123
)
124
+
125
+ subnets := make ([]capxv1.NutanixResourceIdentifier , len (nutanixMachineDetailsVar .Subnets ))
126
+ for _ , subnetCRE := range nutanixMachineDetailsVar .Subnets {
127
+ subnet := capxv1.NutanixResourceIdentifier {Type : capxv1 .NutanixIdentifierType (subnetCRE .Type )}
128
+ if subnetCRE .Type == v1alpha1 .NutanixIdentifierName {
129
+ subnet .Name = subnetCRE .Name
130
+ } else {
131
+ subnet .UUID = subnetCRE .UUID
132
+ }
133
+ subnets = append (subnets , subnet )
134
+ }
135
+
136
+ obj .Spec .Template .Spec .Subnets = subnets
124
137
// TODO
125
- // obj.Spec.Template.Spec.Subnets = nutanixMachineDetailsVar.Subnets
126
138
// obj.Spec.Template.Spec.Project = nutanixMachineDetailsVar.Project
127
139
// obj.Spec.Template.Spec.AdditionalCategories = nutanixMachineDetailsVar.AdditionalCategories
128
140
// obj.Spec.Template.Spec.GPUs = nutanixMachineDetailsVar.GPUs
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/patches/selectors"
19
19
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/variables"
20
20
"github.com/d2iq-labs/capi-runtime-extensions/pkg/handlers/generic/clusterconfig"
21
+ "github.com/nutanix-cloud-native/prism-go-client/environment/credentials"
21
22
)
22
23
23
24
const (
@@ -96,7 +97,14 @@ func (h *nutanixPrismCentralEndpoint) Mutate(
96
97
obj .Spec .Template .Spec .PrismCentral .Address = prismCentralEndpointVar .Host
97
98
obj .Spec .Template .Spec .PrismCentral .Port = prismCentralEndpointVar .Port
98
99
obj .Spec .Template .Spec .PrismCentral .Insecure = prismCentralEndpointVar .Insecure
99
- // TODO obj.Spec.Template.Spec.PrismCentral.AdditionalTrustBundle = prismCentralEndpointVar.AdditionalTrustBundle
100
+ obj .Spec .Template .Spec .PrismCentral .AdditionalTrustBundle = & credentials.NutanixTrustBundleReference {
101
+ Kind : credentials .NutanixTrustBundleKindConfigMap ,
102
+ Name : prismCentralEndpointVar .AdditionalTrustBundle ,
103
+ }
104
+ obj .Spec .Template .Spec .PrismCentral .CredentialRef = & credentials.NutanixCredentialReference {
105
+ Kind : credentials .SecretKind ,
106
+ Name : prismCentralEndpointVar .CredentialSecret ,
107
+ }
100
108
101
109
return nil
102
110
},
You can’t perform that action at this time.
0 commit comments