Skip to content

Commit c926e88

Browse files
committed
Document changes of Filters to Params
1 parent de29a18 commit c926e88

File tree

1 file changed

+66
-7
lines changed

1 file changed

+66
-7
lines changed

docs/book/src/topics/crd-changes/v1alpha7-to-v1beta1.md

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- [Change to image](#change-to-image)
1515
- [Removal of imageUUID](#removal-of-imageuuid)
1616
- [Changes to ports](#changes-to-ports)
17-
- [Additon of floatingIPPoolRef](#additon-of-floatingippoolref)
17+
- [Addition of floatingIPPoolRef](#addition-of-floatingippoolref)
1818
- [`OpenStackCluster`](#openstackcluster)
1919
- [Removal of cloudName](#removal-of-cloudname-1)
2020
- [identityRef is now required](#identityref-is-now-required)
@@ -30,6 +30,7 @@
3030
- [Changes to apiServerLoadBalancer](#changes-to-apiserverloadbalancer)
3131
- [Changes to bastion](#changes-to-bastion)
3232
- [Changes to filters](#changes-to-filters)
33+
- [Filters are replaced by params with separate id and filter](#filters-are-replaced-by-params-with-separate-id-and-filter)
3334
- [Changes to filter tags](#changes-to-filter-tags)
3435
- [Field capitalization consistency](#field-capitalization-consistency)
3536

@@ -171,8 +172,8 @@ Note that this is in contrast `identityRef` in `OpenStackMachine`, which remains
171172

172173
#### Change to externalNetworkID
173174

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.
175+
The field `externalNetworkID` has been renamed to `externalNetwork` and is now a `NetworkParam` object rather than a string ID.
176+
The `NetworkParam` object allows selection of a network by id or filter parameters.
176177

177178
```yaml
178179
externalNetworkID: "e60f19e7-cb37-49f9-a2ee-0a1281f6e03e"
@@ -189,7 +190,8 @@ It is now possible to specify a `NetworkFilter` object to select the external ne
189190

190191
```yaml
191192
externalNetwork:
192-
name: "public"
193+
filter:
194+
name: "public"
193195
```
194196

195197
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.
@@ -239,7 +241,7 @@ The new field has IPv4 validation added.
239241

240242
#### Change to subnet
241243

242-
In v1beta1, `Subnet` of `OpenStackCluster` is modified to `Subnets` to allow specification of two existent subnets for the dual-stack scenario.
244+
In v1beta1, `Subnet` of `OpenStackCluster` is modified to `Subnets` to allow specification of two existing subnets for the dual-stack scenario.
243245

244246
```yaml
245247
subnet:
@@ -253,10 +255,12 @@ In v1beta1, this will be automatically converted to:
253255
- id: a532beb0-c73a-4b5d-af66-3ad05b73d063
254256
```
255257

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`.
258+
`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`.
257259

258260
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.
259261

262+
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`.
263+
260264
#### Change to nodeCidr and dnsNameservers
261265

262266
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:
@@ -386,11 +390,66 @@ spec:
386390
bastion:
387391
spec:
388392
image:
389-
name: foobar
393+
filter:
394+
name: foobar
390395
```
391396

392397
### Changes to filters
393398

399+
#### Filters are replaced by params with separate id and filter
400+
401+
We previously defined filters for specifying each of the following:
402+
* Images
403+
* Networks
404+
* Subnets
405+
* Security Groups
406+
* Routers
407+
408+
Taking Images as an example, in `OpenStackMachineSpec` the `image` parameter accepted the following fields:
409+
* id
410+
* name
411+
* tags
412+
413+
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).
414+
415+
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.
416+
417+
Specifying a filter object by id remains unchanged.
418+
```yaml
419+
image:
420+
id: 02e31c38-d5ba-4c57-addb-00fc71eb5b19
421+
```
422+
423+
Specify a filter object by a filter parameter must now move filter parameters into the filter field:
424+
```yaml
425+
image:
426+
name: my-image
427+
tags:
428+
- my-tag
429+
```
430+
becomes:
431+
```yaml
432+
image:
433+
filter:
434+
name: my-image
435+
tags:
436+
- my-tag
437+
```
438+
439+
The same principal applies to all the filter types. For example:
440+
441+
To specify `externalNetwork` by id in `OpenStackClusterSpec`:
442+
```yaml
443+
externalNetwork:
444+
id: 0a5d4e3d-0a2c-4bed-9172-72544db1f8da
445+
```
446+
or by name:
447+
```yaml
448+
externalNetwork:
449+
filter:
450+
name: my-external-network
451+
```
452+
394453
#### Changes to filter tags
395454

396455
We currently define filters on 4 different Neutron resources which are used throughout the API:

0 commit comments

Comments
 (0)