Skip to content

Commit 60f1079

Browse files
authored
Move HomeAZ to NodeInfo Spec (#3762)
It was discovered that HomeAZ was incorrectly placed in the Status portion of NodeInfo, rather than the Spec, where it should be placed. This is because information in Spec is provided by CNS, while information in the Status is provided by DNC. As CNS is the entity that is initially aware of the HomeAZ of some node, the correct place for this to be communicated is in the Spec. Comments have also been updated to reflect the ownership of these fields, so as to not cause the same confusion to future contributors.
1 parent 6715993 commit 60f1079

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

crd/multitenancy/api/v1alpha1/nodeinfo.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ type NodeInfoList struct {
3232
Items []NodeInfo `json:"items"`
3333
}
3434

35-
// NodeInfoSpec defines the desired state of NodeInfo
35+
// NodeInfoSpec defines the desired state of NodeInfo. This is information
36+
// provided by CNS.
3637
type NodeInfoSpec struct {
3738
// +kubebuilder:validation:Optional
3839
VMUniqueID string `json:"vmUniqueID,omitempty"`
40+
41+
// +kubebuilder:validation:optional
42+
// +kubebuilder:validation:Pattern=`^AZ\d{2}$`
43+
HomeAZ string `json:"homeAZ,omitempty"`
3944
}
4045

41-
// NodeInfoStatus defines the observed state of NodeInfo
46+
// NodeInfoStatus defines the observed state of NodeInfo. This is information
47+
// provided by DNC.
4248
type NodeInfoStatus struct {
4349
// +kubebuilder:validation:Optional
4450
DeviceInfos []DeviceInfo `json:"deviceInfos,omitempty"`
@@ -47,10 +53,6 @@ type NodeInfoStatus struct {
4753
type DeviceInfo struct {
4854
DeviceType DeviceType `json:"deviceType,omitempty"`
4955
MacAddress string `json:"macAddress"`
50-
51-
// +kubebuilder:validation:optional
52-
// +kubebuilder:validation:Pattern=`^AZ\d{2}$`
53-
HomeAZ string `json:"homeAZ,omitempty"`
5456
}
5557

5658
func init() {

crd/multitenancy/manifests/multitenancy.acn.azure.com_nodeinfo.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,20 @@ spec:
4343
metadata:
4444
type: object
4545
spec:
46-
description: NodeInfoSpec defines the desired state of NodeInfo
46+
description: |-
47+
NodeInfoSpec defines the desired state of NodeInfo. This is information
48+
provided by CNS.
4749
properties:
50+
homeAZ:
51+
pattern: ^AZ\d{2}$
52+
type: string
4853
vmUniqueID:
4954
type: string
5055
type: object
5156
status:
52-
description: NodeInfoStatus defines the observed state of NodeInfo
57+
description: |-
58+
NodeInfoStatus defines the observed state of NodeInfo. This is information
59+
provided by DNC.
5360
properties:
5461
deviceInfos:
5562
items:
@@ -59,9 +66,6 @@ spec:
5966
- acn.azure.com/vnet-nic
6067
- acn.azure.com/infiniband-nic
6168
type: string
62-
homeAZ:
63-
pattern: ^AZ\d{2}$
64-
type: string
6569
macAddress:
6670
type: string
6771
required:

0 commit comments

Comments
 (0)