Skip to content

Commit 95bc654

Browse files
committed
Rearrange fields in VMClusterRefOrSpec for clarity
1 parent e2240eb commit 95bc654

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

api/operator/v1alpha1/vmdistributedcluster_types.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,26 @@ type VMDistributedClusterSpec struct {
5151
// VMClusterRefOrSpec is either a reference to existing VMCluster or a specification of a new VMCluster.
5252
// +kubebuilder:validation:Xor=Ref,Spec
5353
type VMClusterRefOrSpec struct {
54-
// Name specifies the static name to be used for the VMCluster when Spec is provided.
55-
// If Ref is used, this field is ignored.
56-
// +optional
57-
Name string `json:"name,omitempty"`
5854
// Ref points to the VMCluster object.
55+
// If Ref is specified, Name and Spec are ignored.
5956
// +optional
6057
Ref *corev1.LocalObjectReference `json:"ref,omitempty"`
61-
// Spec defines the desired state of a new VMCluster.
62-
// +optional
63-
Spec *vmv1beta1.VMClusterSpec `json:"spec,omitempty"`
6458
// OverrideSpec specifies an override to the VMClusterSpec of the referenced object.
65-
// This field is ignored if `Spec` is specified.
6659
// This override is applied to the referenced object if `Ref` is specified.
60+
// This field is ignored if `Spec` is specified.
6761
// +kubebuilder:validation:Type=object
6862
// +kubebuilder:validation:XPreserveUnknownFields
6963
// +optional
7064
OverrideSpec *apiextensionsv1.JSON `json:"overrideSpec,omitempty"`
65+
66+
// Name specifies the static name to be used for the VMCluster when Spec is provided.
67+
// This field is ignored if `Ref` is specified.
68+
// +optional
69+
Name string `json:"name,omitempty"`
70+
// Spec defines the desired state of a new VMCluster.
71+
// This field is ignored if `Ref` is specified.
72+
// +optional
73+
Spec *vmv1beta1.VMClusterSpec `json:"spec,omitempty"`
7174
}
7275

7376
// +k8s:openapi-gen=true

config/crd/overlay/crd.specless.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,17 +1962,19 @@ spec:
19621962
name:
19631963
description: |-
19641964
Name specifies the static name to be used for the VMCluster when Spec is provided.
1965-
If Ref is used, this field is ignored.
1965+
This field is ignored if `Ref` is specified.
19661966
type: string
19671967
overrideSpec:
19681968
description: |-
19691969
OverrideSpec specifies an override to the VMClusterSpec of the referenced object.
1970-
This field is ignored if `Spec` is specified.
19711970
This override is applied to the referenced object if `Ref` is specified.
1971+
This field is ignored if `Spec` is specified.
19721972
type: object
19731973
x-kubernetes-preserve-unknown-fields: true
19741974
ref:
1975-
description: Ref points to the VMCluster object.
1975+
description: |-
1976+
Ref points to the VMCluster object.
1977+
If Ref is specified, Name and Spec are ignored.
19761978
properties:
19771979
name:
19781980
default: ""
@@ -1986,7 +1988,9 @@ spec:
19861988
type: object
19871989
x-kubernetes-map-type: atomic
19881990
spec:
1989-
description: Spec defines the desired state of a new VMCluster.
1991+
description: |-
1992+
Spec defines the desired state of a new VMCluster.
1993+
This field is ignored if `Ref` is specified.
19901994
properties:
19911995
clusterDomainName:
19921996
description: |-

0 commit comments

Comments
 (0)