Skip to content

Commit 1e18474

Browse files
authored
Merge pull request #1452 from Nordix/lentzi90/port_value_specs_gophercloud
✨ Support value specs for Ports
2 parents 3c3c0bd + 3b14d3f commit 1e18474

12 files changed

+416
-20
lines changed

api/v1alpha4/conversion_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ func TestFuzzyConversion(t *testing.T) {
308308
}
309309
}
310310
v1alpha6PortOpts.SecurityGroupFilters = nil
311+
v1alpha6PortOpts.ValueSpecs = nil
311312
},
312313
func(v1alpha6FixedIP *infrav1.FixedIP, c fuzz.Continue) {
313314
c.FuzzNoCustom(v1alpha6FixedIP)

api/v1alpha4/zz_generated.conversion.go

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

api/v1alpha5/conversion.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ func Convert_v1alpha6_LoadBalancer_To_v1alpha5_LoadBalancer(in *infrav1.LoadBala
207207
return autoConvert_v1alpha6_LoadBalancer_To_v1alpha5_LoadBalancer(in, out, s)
208208
}
209209

210+
func Convert_v1alpha6_PortOpts_To_v1alpha5_PortOpts(in *infrav1.PortOpts, out *PortOpts, s conversion.Scope) error {
211+
// value specs have been added in v1alpha6 but have no equivalent in v1apha5
212+
return autoConvert_v1alpha6_PortOpts_To_v1alpha5_PortOpts(in, out, s)
213+
}
214+
210215
func Convert_Slice_v1alpha5_Network_To_Slice_v1alpha6_Network(in *[]Network, out *[]infrav1.Network, s conversion.Scope) error {
211216
*out = make([]infrav1.Network, len(*in))
212217
for i := range *in {

api/v1alpha5/zz_generated.conversion.go

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

api/v1alpha6/types.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ type PortOpts struct {
145145
// These tags are applied in addition to the instance's tags, which will also be applied to the port.
146146
// +listType=set
147147
Tags []string `json:"tags,omitempty"`
148+
149+
// Value specs are extra parameters to include in the API request with OpenStack.
150+
// This is an extension point for the API, so what they do and if they are supported,
151+
// depends on the specific OpenStack implementation.
152+
// +optional
153+
// +listType=map
154+
// +listMapKey=name
155+
ValueSpecs []ValueSpec `json:"valueSpecs,omitempty"`
148156
}
149157

150158
type FixedIP struct {
@@ -316,3 +324,17 @@ type APIServerLoadBalancer struct {
316324
// AllowedCIDRs restrict access to all API-Server listeners to the given address CIDRs.
317325
AllowedCIDRs []string `json:"allowedCidrs,omitempty"`
318326
}
327+
328+
// ValueSpec represents a single value_spec key-value pair.
329+
type ValueSpec struct {
330+
// Name is the name of the key-value pair.
331+
// This is just for identifying the pair and will not be sent to the OpenStack API.
332+
// +kubebuilder:validation:Required
333+
Name string `json:"name"`
334+
// Key is the key in the key-value pair.
335+
// +kubebuilder:validation:Required
336+
Key string `json:"key"`
337+
// Value is the value in the key-value pair.
338+
// +kubebuilder:validation:Required
339+
Value string `json:"value"`
340+
}

api/v1alpha6/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)