Commit a3592c0
authored
backport "feat: Consume the NCStatus to be able to append subnet is full error to Pod IP reservation failures" to release/v1.4 (#2252)
* 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
* feat: Consume the NCStatus to be able to append subnet is full error to Pod IP reservation failures (#2202)
* 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
* Propagated the NC Status inside the CNS and IPAM Monitor pool states
* Fixed the lint error of missing comma
* Saved the updated NC Status into the CNS statefile
* Updated the IP assignment to check and error out subnet is Full when there are no more available IPs for CNS to assign
* Fixed a minor compilation issue
* Fixed lint failures
* Fixed lint failures
* Removed the reference from the metastate of the ipam monitor
* Added Update Success and Update Failed statuses to the NC Status to be able to clearly indicate response status inside the NNC from DNC-RC
* Updated the error to use errors pkg instead of fmt
* Updating the cns reconcillation logic to skip if there is a failure updating the NC and there are no IPs allocated for the NC
* Handled PR comments:
* Updated the code to have the NC status be part of the error directly so that it can be consumed by containerD
and cx can perform actions on it.
* Code update to not use dynamic slices.
* Removed the logic which handled 0 IPs allocated to NNC in CNS reconcile
Signed-off-by: GitHub <[email protected]>
* Addressed the PR comment which helped delete a block of code to store ncIDs and also added more error codes to the NCStatus
---------
Signed-off-by: GitHub <[email protected]>
* Fixed all the compilation failures in the files after chery-pick
---------
Signed-off-by: GitHub <[email protected]>1 parent 5d25eb1 commit a3592c0
File tree
7 files changed
+40
-9
lines changed- cns
- kubecontroller/nodenetworkconfig
- restserver
- crd/nodenetworkconfig
- api/v1alpha
- manifests
7 files changed
+40
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| 545 | + | |
545 | 546 | | |
| 547 | + | |
546 | 548 | | |
547 | 549 | | |
548 | 550 | | |
| |||
557 | 559 | | |
558 | 560 | | |
559 | 561 | | |
560 | | - | |
| 562 | + | |
| 563 | + | |
561 | 564 | | |
562 | 565 | | |
563 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
61 | 74 | | |
62 | 75 | | |
63 | 76 | | |
| |||
107 | 120 | | |
108 | 121 | | |
109 | 122 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | 128 | | |
120 | 129 | | |
| |||
0 commit comments