Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/v1alpha4/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ func TestFuzzyConversion(t *testing.T) {
v1alpha5PortOpts.Network = nil
}
}
v1alpha5PortOpts.SecurityGroupFilters = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bavarianbidi is introducing utilconversion.(Un)MarshalData from Cluster API in #1247 to avoid losing data on a round-trip conversion to v1alpha4 and back to alpha5.

https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1247/files#diff-9a53c6afb893cfd6bb4f50185dea035075cb0ef25fce713667c270d5c9668a31R41

I think it makes sense to also apply this here, though I am not sure about the best process for this, some options:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing it in a follow up PR could be good as I am planning the deprecate the securityGroups field. The reason being, the uuid it provides is also provided by the new introduced securityGroupFilter field.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also fine doing a separate PR as it seems that all conversation unit tests has to be refactored. Already though about but didn't had much time to start the discussion.

},
func(v1alpha5FixedIP *infrav1.FixedIP, c fuzz.Continue) {
c.FuzzNoCustom(v1alpha5FixedIP)
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha4/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions api/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,14 @@ type PortOpts struct {
AdminStateUp *bool `json:"adminStateUp,omitempty"`
MACAddress string `json:"macAddress,omitempty"`
// Specify pairs of subnet and/or IP address. These should be subnets of the network with the given NetworkID.
FixedIPs []FixedIP `json:"fixedIPs,omitempty"`
TenantID string `json:"tenantId,omitempty"`
ProjectID string `json:"projectId,omitempty"`
SecurityGroups *[]string `json:"securityGroups,omitempty"`
AllowedAddressPairs []AddressPair `json:"allowedAddressPairs,omitempty"`
FixedIPs []FixedIP `json:"fixedIPs,omitempty"`
TenantID string `json:"tenantId,omitempty"`
ProjectID string `json:"projectId,omitempty"`
// The uuids of the security groups to assign to the instance
SecurityGroups *[]string `json:"securityGroups,omitempty"`
// The names, uuids, filters or any combination these of the security groups to assign to the instance
SecurityGroupFilters []SecurityGroupParam `json:"securityGroupFilters,omitempty"`
AllowedAddressPairs []AddressPair `json:"allowedAddressPairs,omitempty"`
// Enables and disables trunk at port level. If not provided, openStackMachine.Spec.Trunk is inherited.
Trunk *bool `json:"trunk,omitempty"`

Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha5/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,53 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any combination
these of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups
in openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups to assign
to the instance
items:
type: string
type: array
Expand Down Expand Up @@ -3252,7 +3298,53 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any combination
these of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups
in openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups to assign
to the instance
items:
type: string
type: array
Expand Down Expand Up @@ -3586,7 +3678,53 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any combination
these of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups in
openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups to assign to
the instance
items:
type: string
type: array
Expand Down Expand Up @@ -3834,7 +3972,53 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any combination
these of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups in
openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups to assign to
the instance
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,54 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any
combination these of the security groups to
assign to the instance
items:
properties:
filter:
description: Filters used to query security
groups in openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups
to assign to the instance
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,53 @@ spec:
type: object
projectId:
type: string
securityGroupFilters:
description: The names, uuids, filters or any combination these
of the security groups to assign to the instance
items:
properties:
filter:
description: Filters used to query security groups in
openstack
properties:
description:
type: string
id:
type: string
limit:
type: integer
marker:
type: string
name:
type: string
notTags:
type: string
notTagsAny:
type: string
projectId:
type: string
sortDir:
type: string
sortKey:
type: string
tags:
type: string
tagsAny:
type: string
tenantId:
type: string
type: object
name:
description: Security Group name
type: string
uuid:
description: Security Group UID
type: string
type: object
type: array
securityGroups:
description: The uuids of the security groups to assign to the
instance
items:
type: string
type: array
Expand Down
Loading