Skip to content

Commit e9bf0fa

Browse files
committed
apis.sync changes
1 parent 8baca77 commit e9bf0fa

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

api/external/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1/conditions.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ const (
5454

5555
const (
5656
// PrismCentralClientCondition indicates the status of the client used to connect to Prism Central
57-
PrismCentralClientCondition capiv1.ConditionType = "PrismClientInit"
58-
PrismCentralV4ClientCondition capiv1.ConditionType = "PrismClientV4Init"
57+
PrismCentralClientCondition capiv1.ConditionType = "PrismClientInit"
58+
PrismCentralV4ClientCondition capiv1.ConditionType = "PrismClientV4Init"
59+
PrismCentralConvergedV4ClientCondition capiv1.ConditionType = "PrismClientConvergedV4Init"
5960

60-
PrismCentralClientInitializationFailed = "PrismClientInitFailed"
61-
PrismCentralV4ClientInitializationFailed = "PrismClientV4InitFailed"
61+
PrismCentralClientInitializationFailed = "PrismClientInitFailed"
62+
PrismCentralV4ClientInitializationFailed = "PrismClientV4InitFailed"
63+
PrismCentralConvergedV4ClientInitializationFailed = "PrismClientConvergedV4InitFailed"
6264
)
6365

6466
const (

api/external/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1/nutanix_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const (
6161

6262
// NutanixResourceIdentifier holds the identity of a Nutanix PC resource (cluster, image, subnet, etc.)
6363
// +union
64+
// +kubebuilder:validation:XValidation:rule="self.type == 'name' ? has(self.name) : !has(self.name)",message="'name' must be set when type is 'name', and forbidden otherwise"
65+
// +kubebuilder:validation:XValidation:rule="self.type == 'uuid' ? has(self.uuid) && self.uuid.contains('-') : !has(self.uuid)",message="'uuid' must be set when type is 'uuid', and forbidden otherwise"
6466
type NutanixResourceIdentifier struct {
6567
// Type is the identifier type to use for this resource.
6668
// +kubebuilder:validation:Required
@@ -69,10 +71,14 @@ type NutanixResourceIdentifier struct {
6971

7072
// uuid is the UUID of the resource in the PC.
7173
// +optional
74+
// +kubebuilder:validation:Format=uuid
75+
// +kubebuilder:validation:MaxLength=36
76+
// +kubebuilder:validation:MinLength=36
7277
UUID *string `json:"uuid,omitempty"`
7378

7479
// name is the resource name in the PC
7580
// +optional
81+
// +kubebuilder:validation:MinLength=1
7682
Name *string `json:"name,omitempty"`
7783
}
7884

api/external/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1/nutanixfailuredomain_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const (
3131
)
3232

3333
// NutanixFailureDomainSpec defines the desired state of NutanixFailureDomain.
34+
// +kubebuilder:validation:XValidation:rule="size(self.subnets) > 1 ? self.subnets.all(x, self.subnets.exists_one(y, x == y)) : true",message="each subnet must be unique"
3435
type NutanixFailureDomainSpec struct {
3536
// prismElementCluster is to identify the Prism Element cluster in the Prism Central for the failure domain.
3637
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="prismElementCluster is immutable once set"
@@ -42,6 +43,7 @@ type NutanixFailureDomainSpec struct {
4243
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="subnets is immutable once set"
4344
// +kubebuilder:validation:Required
4445
// +kubebuilder:validation:MinItems=1
46+
// +kubebuilder:validation:MaxItems=32
4547
Subnets []NutanixResourceIdentifier `json:"subnets"`
4648
}
4749

api/external/github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1/nutanixmachine_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type NutanixImageLookup struct {
9898

9999
// NutanixMachineSpec defines the desired state of NutanixMachine
100100
// +kubebuilder:validation:XValidation:rule="has(self.image) != has(self.imageLookup)",message="Either 'image' or 'imageLookup' must be set, but not both"
101+
// +kubebuilder:validation:XValidation:rule="has(self.subnet) && size(self.subnet) > 1 ? self.subnet.all(x, self.subnet.exists_one(y, x == y)) : true",message="each subnet must be unique"
101102
type NutanixMachineSpec struct {
102103
// SPEC FIELDS - desired state of NutanixMachine
103104
// Important: Run "make" to regenerate code after modifying this file
@@ -136,6 +137,7 @@ type NutanixMachineSpec struct {
136137
// subnet is to identify the cluster's network subnet to use for the Machine's VM
137138
// The cluster identifier (uuid or name) can be obtained from the Prism Central console
138139
// or using the prism_central API.
140+
// +kubebuilder:validation:MaxItems=32
139141
// +kubebuilder:validation:Optional
140142
Subnets []NutanixResourceIdentifier `json:"subnet,omitempty"`
141143
// List of categories that need to be added to the machines. Categories must already exist in Prism Central

0 commit comments

Comments
 (0)