Commit 468f567
Implement Mixed Mode State Detection
This patch introduces the Mixed Mode state detection logic for NSX Operator
to determine the network scope (T1, VPC, or VDS) it operates within. This
is critical for deciding which controllers should be activated.
Key features:
- Introduced an informer for the NetworkSettings CR in the Controller
Runtime cache to efficiently determine the global network state.
- Added detection logic for VDS alongside T1 and VPC based on the
NetworkSettings `provider` field.
- Implemented capability checking by reading the
`supports_per_namespace_network_provider` key from the `status.supervisor`
path in the Capabilities CR.
- Incorporated the `EnableVPCNetwork` configuration override to act as an
early trigger. This solves the "chicken-and-egg" problem by allowing
VPC-specific controllers to start before the NetworkSettings CRs are
updated to `provider: vpc`.
- Wrapped all corresponding controller capability gates to strictly use
the global `config.HasVPCNamespaces()` and `config.HasT1Namespaces()`
checks.
After this change, the NSX-Operator will start VPC controllers as long as
enable_vpc_network is true. And the T1 controllers will be started when:
(supports_per_namespace_network_provider is activated) AND (at least one NetworkingSettings CR has provider=="nsx-tier1")
OR
(supports_per_namespace_network_provider is deactivated) AND (enable_vpc_network is false)
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 128342c commit 468f567
13 files changed
Lines changed: 880 additions & 73 deletions
File tree
- cmd
- pkg
- config
- controllers/securitypolicy
- mock/realizedentitiesclient
- nsx
- services/securitypolicy
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
303 | 317 | | |
304 | 318 | | |
305 | 319 | | |
| |||
345 | 359 | | |
346 | 360 | | |
347 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
348 | 368 | | |
349 | 369 | | |
350 | 370 | | |
| |||
0 commit comments