feat(openstack-sync): add NeutronSegmentRange CRD and sync plugin - #2352
geetikabatra wants to merge 3 commits into
Conversation
Add a NeutronSegmentRange CRD to the openstack-sync-operator and a segment_ranges hook plus plugin package that reconciles Neutron network segment ranges from custom resources, built on the new SyncPlugin framework. - CRD: neutron.understack.rackspace.net/v1alpha1 NeutronSegmentRange - plugin: reconcile/create/adopt by owner-prefixed name, prune on removal - immutable network_type/physical_network mismatches fail loudly - wired into operator values.yaml (plugins.neutronSegmentRanges, disabled) - prune driven by framework CleanupPolicy (no manual config.prune gate)
Python test results1 tests - 62 1 ✅ - 62 0s ⏱️ -7s Results for commit b1b883f. ± Comparison against base commit 9f78877. This pull request removes 63 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
| it must be unique per cloud. | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 255 |
There was a problem hiding this comment.
We are prepending NAME_PREFIX = "understack-sr:" which is 14 chars,
so the CRD’s safe spec.name max should be 241.
| this at reconcile time. | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 255 |
There was a problem hiding this comment.
physical_network should be capped at 64
physical_network = sa.Column(sa.String(64), nullable=False,
server_default='')
| ) | ||
| want = { | ||
| "network_type": spec["network_type"], | ||
| "physical_network": spec.get("physical_network"), |
There was a problem hiding this comment.
This makes tunnel segment ranges non-idempotent.
For vxlan/gre/geneve, the spec can omit physical_network, but Neutron normalizes non-VLAN segment ranges to physical_network="".
is_vlan = self.network_type == constants.TYPE_VLAN
self.physical_network = kwargs['physical_network'] if is_vlan else ''
- cap spec.name at 241 chars: the 14-char understack-sr: ownership prefix has to fit inside Neutron's 255-char name column - cap physical_network at 64 chars to match Neutron's String(64) column - normalize physical_network to "" when checking immutable drift. Neutron stores non-VLAN ranges with physical_network='' while a tunnelled spec omits the field, so the raw comparison reported drift on every reconcile of a vxlan/gre/geneve range against its own spec
|
CRD schema and the name-prefix ownership marker both look right. Two blockers though. Needs a rebase first — main moved under it. CI is green because Prune treats an in-use range as a successful delete. Smaller:
|
Add a NeutronSegmentRange CRD to the openstack-sync-operator and a segment_ranges hook plus plugin package that reconciles Neutron network segment ranges from custom resources, built on the new SyncPlugin framework.
What does this change do?
Upgrade impact
upgrade-impactlabel and a release note: runscriv createfrom therepository root and describe the required action in the generated
changelog.d/file. See RELEASING.md.Operator action means anything a deployment has to do beyond a normal resync:
deploy repo or values changes, new or removed secrets, enabling or disabling a
component, or a manual one-time step.