Skip to content

Commit

Permalink
Feat: Created a Network Container Status Section to be updated with t…
Browse files Browse the repository at this point in the history
…he latest error code (Azure#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
  • Loading branch information
nairashu committed Sep 25, 2023
1 parent 5d25eb1 commit 9b1da7e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
22 changes: 16 additions & 6 deletions crd/nodenetworkconfig/api/v1alpha/nodenetworkconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ const (
Error Status = "Error"
)

// NCStatus indicates the latest NC request status
// +kubebuilder:validation:Enum=SubnetFull
// +kubebuilder:validation:Optional
type NCStatus string

const (
NCStatusSubnetFull NCStatus = "SubnetFull"
)

// NodeNetworkConfigStatus defines the observed state of NetworkConfig
type NodeNetworkConfigStatus struct {
// +kubebuilder:default=0
Expand Down Expand Up @@ -107,12 +116,13 @@ type NetworkContainer struct {
SubnetAddressSpace string `json:"subnetAddressSpace,omitempty"`
// +kubebuilder:default=0
// +kubebuilder:validation:Optional
Version int64 `json:"version"`
NodeIP string `json:"nodeIP,omitempty"`
SubscriptionID string `json:"subcriptionID,omitempty"`
ResourceGroupID string `json:"resourceGroupID,omitempty"`
VNETID string `json:"vnetID,omitempty"`
SubnetID string `json:"subnetID,omitempty"`
Version int64 `json:"version"`
NodeIP string `json:"nodeIP,omitempty"`
SubscriptionID string `json:"subcriptionID,omitempty"`
ResourceGroupID string `json:"resourceGroupID,omitempty"`
VNETID string `json:"vnetID,omitempty"`
SubnetID string `json:"subnetID,omitempty"`
Status NCStatus `json:"status,omitempty"`
}

// IPAssignment groups an IP address and Name. Name is a UUID set by the the IP address assigner.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ spec:
type: string
resourceGroupID:
type: string
status:
description: NCStatus indicates the latest NC request status
enum:
- SubnetFull
type: string
subcriptionID:
type: string
subnetAddressSpace:
Expand Down

0 comments on commit 9b1da7e

Please sign in to comment.