You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -84,16 +85,18 @@ To select a server group by name instead of ID:
84
85
85
86
```yaml
86
87
serverGroup:
87
-
name: "workers"
88
+
filter:
89
+
name: "workers"
88
90
```
89
91
90
-
If a server group is provided and found, it'll be added to `OpenStackMachine.Status.ReferencedResources.ServerGroupID`. If the server group can't be found or filter matches multiple server groups, an error will be returned.
91
-
If empty object or null is provided, Machine will not be added to any server group and `OpenStackMachine.Status.ReferencedResources.ServerGroupID` will be empty.
92
+
If a server group is provided and found, it will be added to `OpenStackMachine.Status.ReferencedResources.ServerGroupID`. If the server group can't be found or filter matches multiple server groups, an error will be returned.
93
+
If no serverGroup is provided, Machine will not be added to any server group and `OpenStackMachine.Status.ReferencedResources.ServerGroupID` will be empty.
94
+
It is an error to provide an empty serverGroup.
92
95
93
96
#### Change to image
94
97
95
-
The field `image` is now an `ImageFilter` object rather than a string name.
96
-
The `ImageFilter` object allows selection of an image by ID or by name and tags. If ID is set, no other fields can be set in the object.
98
+
The field `image` is now an `ImageParam` object rather than a string name.
99
+
The `ImageParam` object allows selection of an image by ID or by filter. Either ID or a filter may be set, but not both.
97
100
98
101
```yaml
99
102
image: "test-image"
@@ -103,7 +106,8 @@ becomes
103
106
104
107
```yaml
105
108
image:
106
-
name: "test-image"
109
+
filter:
110
+
name: "test-image"
107
111
```
108
112
109
113
The image ID will be added to `OpenStackMachine.Status.ReferencedResources.ImageID`. If the image can't be found or filter matches multiple images, an error will be returned.
@@ -171,8 +175,8 @@ Note that this is in contrast `identityRef` in `OpenStackMachine`, which remains
171
175
172
176
#### Change to externalNetworkID
173
177
174
-
The field `externalNetworkID` has been renamed to `externalNetwork` and is now a `NetworkFilter` object rather than a string ID.
175
-
The `NetworkFilter` object allows selection of a network by name, by ID or by tags.
178
+
The field `externalNetworkID` has been renamed to `externalNetwork` and is now a `NetworkParam` object rather than a string ID.
179
+
The `NetworkParam` object allows selection of a network by id or filter parameters.
It is now possible to specify a `NetworkFilter` object to select the external network to use for the cluster. The `NetworkFilter` object allows to select the network by name, by ID or by tags.
192
+
It is now possible to specify a `NetworkParam` object to select the external network to use for the cluster. The `NetworkParam` object allows to select the network by id or by filter, which can select by name, ID or tags.
189
193
190
194
```yaml
191
195
externalNetwork:
192
-
name: "public"
196
+
filter:
197
+
name: "public"
193
198
```
194
199
195
-
If a network is provided, it'll be added to `OpenStackCluster.Status.ExternalNetwork`. If the network can't be found, an error will be returned.
200
+
If a network is provided, it will be added to `OpenStackCluster.Status.ExternalNetwork`. If the network can't be found, an error will be returned.
196
201
If no network is provided, CAPO will try to find network marked "External" and add it to `OpenStackCluster.Status.ExternalNetwork`. If it can't find a network marked "External",
197
202
`OpenStackCluster.Status.ExternalNetwork`will be set to nil.
198
203
If more than one network is found, an error will be returned.
@@ -239,7 +244,7 @@ The new field has IPv4 validation added.
239
244
240
245
#### Change to subnet
241
246
242
-
In v1beta1, `Subnet` of `OpenStackCluster` is modified to `Subnets` to allow specification of two existent subnets for the dual-stack scenario.
247
+
In v1beta1, `Subnet` of `OpenStackCluster` is modified to `Subnets` to allow specification of two existing subnets for the dual-stack scenario.
243
248
244
249
```yaml
245
250
subnet:
@@ -253,10 +258,12 @@ In v1beta1, this will be automatically converted to:
253
258
- id: a532beb0-c73a-4b5d-af66-3ad05b73d063
254
259
```
255
260
256
-
`Subnets`allows specifications of maximum two `SubnetFilter` one being IPv4 and the other IPv6. Both subnets must be on the same network. Any filtered subnets will be added to `OpenStackCluster.Status.Network.Subnets`.
261
+
`Subnets`allows specifications of maximum two `SubnetParam`s one being IPv4 and the other IPv6. Both subnets must be on the same network. Any filtered subnets will be added to `OpenStackCluster.Status.Network.Subnets`.
257
262
258
263
When subnets are not specified on `OpenStackCluster` and only the network is, the network is used to identify the subnets to use. If more than two subnets exist in the network, the user must specify which ones to use by defining the `OpenStackCluster.Spec.Subnets` field.
259
264
265
+
See [Filters are replaced by params with separate id and filter](#filters-are-replaced-by-params-with-separate-id-and-filter) for changes to the `SubnetFilter`.
266
+
260
267
#### Change to nodeCidr and dnsNameservers
261
268
262
269
In v1beta1, `OpenStackCluster.Spec.ManagedSubnets` array field is introduced. The `NodeCIDR` and `DNSNameservers` fields of `OpenStackCluster.Spec` are moved into that structure (renaming `NodeCIDR` to `CIDR`). For example:
@@ -388,11 +395,68 @@ spec:
388
395
bastion:
389
396
spec:
390
397
image:
391
-
name: foobar
398
+
filter:
399
+
name: foobar
392
400
```
393
401
394
402
### Changes to filters
395
403
404
+
#### Filters are replaced by params with separate id and filter
405
+
406
+
We previously defined filters for specifying each of the following:
407
+
* Images
408
+
* Networks
409
+
* Subnets
410
+
* Security Groups
411
+
* Routers
412
+
413
+
In addition, ServerGroupParam is new in v1beta1, but works in the same way.
414
+
415
+
Taking Images as an example, in `OpenStackMachineSpec` the `image` parameter accepted the following fields:
416
+
* id
417
+
* name
418
+
* tags
419
+
420
+
However, there were 2 different behaviours here depending on which fields were specified. If `id` was specified we both ignored all other fields, and made no attempt to validate the id because it cannot be known unless it exists. If `id` was not specified we performed an OpenStack query using the other parameters to determine the id. This behaviour is both difficult to describe and validate, so in v1beta1 we have separated the 2 different behaviours into different fields. The `id` field remains, but all other fields become part of a new `filter` parameter. It is required to specify either `id` or `filter`. Specifying both, neither, or an empty filter, will now result in an admission failure (the API server will reject the operation immediately).
421
+
422
+
We have also added validation to the id field, which must now parse as a uuid. An id field which does not parse as a uuid will also result in an admission failure.
423
+
424
+
Specifying a filter object by id remains unchanged.
425
+
```yaml
426
+
image:
427
+
id: 02e31c38-d5ba-4c57-addb-00fc71eb5b19
428
+
```
429
+
430
+
Specifying a filter object by a filter parameter must now move filter parameters into the filter field:
431
+
```yaml
432
+
image:
433
+
name: my-image
434
+
tags:
435
+
- my-tag
436
+
```
437
+
becomes:
438
+
```yaml
439
+
image:
440
+
filter:
441
+
name: my-image
442
+
tags:
443
+
- my-tag
444
+
```
445
+
446
+
The same principle applies to all the filter types. For example:
447
+
448
+
To specify `externalNetwork` by id in `OpenStackClusterSpec`:
449
+
```yaml
450
+
externalNetwork:
451
+
id: 0a5d4e3d-0a2c-4bed-9172-72544db1f8da
452
+
```
453
+
or by name:
454
+
```yaml
455
+
externalNetwork:
456
+
filter:
457
+
name: my-external-network
458
+
```
459
+
396
460
#### Changes to filter tags
397
461
398
462
We currently define filters on 4 different Neutron resources which are used throughout the API:
0 commit comments