Skip to content

Commit 210fe86

Browse files
authored
Feat: Created a Network Container Status Section to be updated with the latest error code (#2193)
* Added Network Conatiner Status to include the latest error code for a Network Container * Updated the crd to have the Status field included into the Network Container * Updated the names and added Status and ErrorText as two fields in NC Status * Fixed the casing and json values for these variables * Added error code to the NC Status and removed the latest prefix from the varibale names * Removed the timestamp variable from the NC Status * Moved the Status object inside the NC Status to be able to accurately define the status of each NC for the node * Changed to having an enum representing the NC Status which DNC-RC will update after inferring the error and CNS can use this field to propagate and NCRequest failures * Made the validation of the new enum optional to keep it backward compatible
1 parent a90a77e commit 210fe86

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

crd/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ const (
5858
Error Status = "Error"
5959
)
6060

61+
// NCStatus indicates the latest NC request status
62+
// +kubebuilder:validation:Enum=SubnetFull
63+
// +kubebuilder:validation:Optional
64+
type NCStatus string
65+
66+
const (
67+
NCStatusSubnetFull NCStatus = "SubnetFull"
68+
)
69+
6170
// NodeNetworkConfigStatus defines the observed state of NetworkConfig
6271
type NodeNetworkConfigStatus struct {
6372
// +kubebuilder:default=0
@@ -108,12 +117,13 @@ type NetworkContainer struct {
108117
SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"`
109118
// +kubebuilder:default=0
110119
// +kubebuilder:validation:Optional
111-
Version int64 `json:"version"`
112-
NodeIP string `json:"nodeIP,omitempty"`
113-
SubscriptionID string `json:"subcriptionID,omitempty"`
114-
ResourceGroupID string `json:"resourceGroupID,omitempty"`
115-
VNETID string `json:"vnetID,omitempty"`
116-
SubnetID string `json:"subnetID,omitempty"`
120+
Version int64 `json:"version"`
121+
NodeIP string `json:"nodeIP,omitempty"`
122+
SubscriptionID string `json:"subcriptionID,omitempty"`
123+
ResourceGroupID string `json:"resourceGroupID,omitempty"`
124+
VNETID string `json:"vnetID,omitempty"`
125+
SubnetID string `json:"subnetID,omitempty"`
126+
Status NCStatus `json:"status,omitempty"`
117127
}
118128

119129
// IPAssignment groups an IP address and Name. Name is a UUID set by the the IP address assigner.

crd/nodenetworkconfig/manifests/acn.azure.com_nodenetworkconfigs.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ spec:
115115
type: string
116116
resourceGroupID:
117117
type: string
118+
status:
119+
description: NCStatus indicates the latest NC request status
120+
enum:
121+
- SubnetFull
122+
type: string
118123
subcriptionID:
119124
type: string
120125
subnetAddressSpace:

0 commit comments

Comments
 (0)