Sitelet https://github.com/k-orc/openstack-resource-controller/pull/965
Skip to content

fix(securitygroup): deliberately-empty rules list never reaches Available - #965

Merged
mandre merged 1 commit into
k-orc:release-2.0from
shiftstack:empty-rules-sg-v2
Oct 5, 2026
Merged

mandre merged 1 commit into
k-orc:release-2.0from
shiftstack:empty-rules-sg-v2

Conversation

@mandre

@mandre mandre commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

A SecurityGroup with spec.resource.rules set to an empty list stayed at Available=False forever. ApplyResourceStatus only writes status.resource.rules inside a loop over the OpenStack rules, so an empty group never gets that field, and the old check against orcObject.Status.Resource.Rules could never pass.

Compare the rule count against this reconcile's fresh osResource instead, which has no nil-versus-empty ambiguity. Adds a table-driven regression test covering the empty, short, and matching cases.

Manual backport of #961.

…able

A SecurityGroup with spec.resource.rules set to an empty list stayed at
Available=False forever. ApplyResourceStatus only writes status.resource.rules
inside a loop over the OpenStack rules, so an empty group never gets that field,
and the old check against orcObject.Status.Resource.Rules could never pass.

Compare the rule count against this reconcile's fresh osResource instead, which
has no nil-versus-empty ambiguity. Adds a table-driven regression test covering
the empty, short, and matching cases.

Fixes k-orc#960
@mandre
mandre enabled auto-merge October 5, 2026 15:04
@github-actions github-actions Bot added v2.0 This PR targets v2.0 semver:patch No API change labels Oct 5, 2026
@mandre
mandre added this pull request to the merge queue Oct 5, 2026
Merged via the queue into k-orc:release-2.0 with commit c6773fa Oct 5, 2026
10 checks passed
@mandre
mandre deleted the empty-rules-sg-v2 branch October 5, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change v2.0 This PR targets v2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants