Skip to content

Commit f747456

Browse files
committed
Rules are optional in security group rules before v1beta1
Rules were removed from the security group status in v1beta1. If the status is modified then an up-converted v1alphaN object will not have its security group rules restored on down-conversion. As the CRD requires rules, this results in an API error.
1 parent acc680d commit f747456

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed

api/v1alpha5/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ type LoadBalancer struct {
241241
type SecurityGroup struct {
242242
Name string `json:"name"`
243243
ID string `json:"id"`
244-
Rules []SecurityGroupRule `json:"rules"`
244+
Rules []SecurityGroupRule `json:"rules,omitempty"`
245245
}
246246

247247
// SecurityGroupRule represent the basic information of the associated OpenStack

api/v1alpha6/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ type LoadBalancer struct {
253253
type SecurityGroup struct {
254254
Name string `json:"name"`
255255
ID string `json:"id"`
256-
Rules []SecurityGroupRule `json:"rules"`
256+
Rules []SecurityGroupRule `json:"rules,omitempty"`
257257
}
258258

259259
// SecurityGroupRule represent the basic information of the associated OpenStack

api/v1alpha7/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ type LoadBalancer struct {
281281
type SecurityGroup struct {
282282
Name string `json:"name"`
283283
ID string `json:"id"`
284-
Rules []SecurityGroupRule `json:"rules"`
284+
Rules []SecurityGroupRule `json:"rules,omitempty"`
285285
}
286286

287287
// SecurityGroupRule represent the basic information of the associated OpenStack

config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)