Skip to content

Commit f94a1ae

Browse files
committed
Revert "Move FloatingIP to Bastion spec"
This reverts commit f19a6cc. This change required a version bump. We will re-add this change after creating the required version bump.
1 parent f323b4f commit f94a1ae

13 files changed

+50
-126
lines changed

api/v1alpha5/conversion.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,6 @@ func Convert_v1alpha5_PortOpts_To_v1alpha7_PortOpts(in *PortOpts, out *infrav1.P
238238
return nil
239239
}
240240

241-
func Convert_v1alpha5_OpenStackMachineSpec_To_v1alpha7_Bastion(in *OpenStackMachineSpec, out *infrav1.Bastion, _ conversion.Scope) error {
242-
out.FloatingIP = in.FloatingIP
243-
return nil
244-
}
245-
246-
func Convert_v1alpha7_Bastion_To_v1alpha5_OpenStackMachineSpec(in *infrav1.Bastion, out *OpenStackMachineSpec, _ conversion.Scope) error {
247-
out.FloatingIP = in.FloatingIP
248-
return nil
249-
}
250-
251241
func Convert_v1alpha5_Instance_To_v1alpha7_BastionStatus(in *Instance, out *infrav1.BastionStatus, _ conversion.Scope) error {
252242
// BastionStatus is the same as Instance with unused fields removed
253243
out.ID = in.ID
@@ -447,12 +437,3 @@ func Convert_v1alpha5_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(
447437
func Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in *infrav1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error {
448438
return autoConvert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in, out, s)
449439
}
450-
451-
func Convert_v1alpha7_Bastion_To_v1alpha5_Bastion(in *infrav1.Bastion, out *Bastion, s conversion.Scope) error {
452-
err := autoConvert_v1alpha7_Bastion_To_v1alpha5_Bastion(in, out, s)
453-
if err != nil {
454-
return err
455-
}
456-
in.FloatingIP = out.Instance.FloatingIP
457-
return nil
458-
}

api/v1alpha5/zz_generated.conversion.go

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

api/v1alpha6/conversion.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ func restorev1alpha6MachineSpec(previous *OpenStackMachineSpec, dst *OpenStackMa
4040
dst.Networks = previous.Networks
4141
dst.Ports = previous.Ports
4242
dst.SecurityGroups = previous.SecurityGroups
43-
44-
// FloatingIP is removed from v1alpha7 with no replacement, so can't be
45-
// losslessly converted. Restore the previously stored value on down-conversion.
46-
dst.FloatingIP = previous.FloatingIP
4743
}
4844

4945
func restorev1alpha6ClusterStatus(previous *OpenStackClusterStatus, dst *OpenStackClusterStatus) {
@@ -476,16 +472,6 @@ func Convert_v1alpha7_PortOpts_To_v1alpha6_PortOpts(in *infrav1.PortOpts, out *P
476472
return nil
477473
}
478474

479-
func Convert_v1alpha6_OpenStackMachineSpec_To_v1alpha7_Bastion(in *OpenStackMachineSpec, out *infrav1.Bastion, _ apiconversion.Scope) error {
480-
out.FloatingIP = in.FloatingIP
481-
return nil
482-
}
483-
484-
func Convert_v1alpha7_Bastion_To_v1alpha6_OpenStackMachineSpec(in *infrav1.Bastion, out *OpenStackMachineSpec, _ apiconversion.Scope) error {
485-
out.FloatingIP = in.FloatingIP
486-
return nil
487-
}
488-
489475
func Convert_v1alpha6_Instance_To_v1alpha7_BastionStatus(in *Instance, out *infrav1.BastionStatus, _ apiconversion.Scope) error {
490476
// BastionStatus is the same as Instance with unused fields removed
491477
out.ID = in.ID
@@ -673,12 +659,3 @@ func Convert_v1alpha6_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(
673659
func Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha6_OpenStackMachineSpec(in *infrav1.OpenStackMachineSpec, out *OpenStackMachineSpec, s apiconversion.Scope) error {
674660
return autoConvert_v1alpha7_OpenStackMachineSpec_To_v1alpha6_OpenStackMachineSpec(in, out, s)
675661
}
676-
677-
func Convert_v1alpha7_Bastion_To_v1alpha6_Bastion(in *infrav1.Bastion, out *Bastion, s apiconversion.Scope) error {
678-
err := autoConvert_v1alpha7_Bastion_To_v1alpha6_Bastion(in, out, s)
679-
if err != nil {
680-
return err
681-
}
682-
in.FloatingIP = out.Instance.FloatingIP
683-
return nil
684-
}

api/v1alpha6/zz_generated.conversion.go

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

api/v1alpha7/openstackmachine_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ type OpenStackMachineSpec struct {
6060
// If not specified a default port will be added for the default cluster network.
6161
Ports []PortOpts `json:"ports,omitempty"`
6262

63+
// The floatingIP which will be associated to the machine, only used for master.
64+
// The floatingIP should have been created and haven't been associated.
65+
FloatingIP string `json:"floatingIP,omitempty"`
66+
6367
// The names of the security groups to assign to the instance
6468
SecurityGroups []SecurityGroupFilter `json:"securityGroups,omitempty"`
6569

api/v1alpha7/types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,6 @@ type Bastion struct {
344344

345345
//+optional
346346
AvailabilityZone string `json:"availabilityZone,omitempty"`
347-
348-
// FloatingIP which will be associated to the bastion machine.
349-
// The floating IP should already exist and should not be associated with a port.
350-
//+optional
351-
FloatingIP string `json:"floatingIP,omitempty"`
352347
}
353348

354349
type APIServerLoadBalancer struct {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,11 +3767,6 @@ spec:
37673767
type: string
37683768
enabled:
37693769
type: boolean
3770-
floatingIP:
3771-
description: FloatingIP which will be associated to the bastion
3772-
machine. The floating IP should already exist and should not
3773-
be associated with a port.
3774-
type: string
37753770
instance:
37763771
description: Instance for the bastion itself
37773772
properties:
@@ -3847,6 +3842,11 @@ spec:
38473842
description: The flavor reference for the flavor for your
38483843
server instance.
38493844
type: string
3845+
floatingIP:
3846+
description: The floatingIP which will be associated to the
3847+
machine, only used for master. The floatingIP should have
3848+
been created and haven't been associated.
3849+
type: string
38503850
identityRef:
38513851
description: IdentityRef is a reference to a identity to be
38523852
used when reconciling this cluster

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,11 +1607,6 @@ spec:
16071607
type: string
16081608
enabled:
16091609
type: boolean
1610-
floatingIP:
1611-
description: FloatingIP which will be associated to the
1612-
bastion machine. The floating IP should already exist
1613-
and should not be associated with a port.
1614-
type: string
16151610
instance:
16161611
description: Instance for the bastion itself
16171612
properties:
@@ -1693,6 +1688,11 @@ spec:
16931688
description: The flavor reference for the flavor for
16941689
your server instance.
16951690
type: string
1691+
floatingIP:
1692+
description: The floatingIP which will be associated
1693+
to the machine, only used for master. The floatingIP
1694+
should have been created and haven't been associated.
1695+
type: string
16961696
identityRef:
16971697
description: IdentityRef is a reference to a identity
16981698
to be used when reconciling this cluster

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ spec:
12261226
flavor:
12271227
description: The flavor reference for the flavor for your server instance.
12281228
type: string
1229+
floatingIP:
1230+
description: The floatingIP which will be associated to the machine,
1231+
only used for master. The floatingIP should have been created and
1232+
haven't been associated.
1233+
type: string
12291234
identityRef:
12301235
description: IdentityRef is a reference to a identity to be used when
12311236
reconciling this cluster

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,11 @@ spec:
10301030
description: The flavor reference for the flavor for your
10311031
server instance.
10321032
type: string
1033+
floatingIP:
1034+
description: The floatingIP which will be associated to the
1035+
machine, only used for master. The floatingIP should have
1036+
been created and haven't been associated.
1037+
type: string
10331038
identityRef:
10341039
description: IdentityRef is a reference to a identity to be
10351040
used when reconciling this cluster

controllers/openstackcluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func reconcileBastion(scope scope.Scope, cluster *clusterv1.Cluster, openStackCl
359359
return err
360360
}
361361
clusterName := fmt.Sprintf("%s-%s", cluster.Namespace, cluster.Name)
362-
fp, err := networkingService.GetOrCreateFloatingIP(openStackCluster, openStackCluster, clusterName, openStackCluster.Spec.Bastion.FloatingIP)
362+
fp, err := networkingService.GetOrCreateFloatingIP(openStackCluster, openStackCluster, clusterName, openStackCluster.Spec.Bastion.Instance.FloatingIP)
363363
if err != nil {
364364
handleUpdateOSCError(openStackCluster, fmt.Errorf("failed to get or create floating IP for bastion: %w", err))
365365
return fmt.Errorf("failed to get or create floating IP for bastion: %w", err)

docs/book/src/clusteropenstack/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ spec:
626626
...
627627
bastion:
628628
...
629-
floatingIP: <Floating IP address>
629+
floatingIP: <Floating IP address>
630630
```
631631

632632
If `managedSecurityGroups: true`, security group rule opening 22/tcp is added to security groups for bastion, controller, and worker nodes respectively. Otherwise, you have to add `securityGroups` to the `bastion` in `OpenStackCluster` spec and `OpenStackMachineTemplate` spec template respectively.

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
- [`OpenStackMachine`](#openstackmachine)
99
- [⚠️ Removal of networks](#-removal-of-networks)
1010
- [Removal of subnet](#removal-of-subnet)
11-
- [Change to floatingIP](#change-to-floatingip)
1211
- [Change to securityGroups](#change-to-securitygroups)
1312
- [Changes to ports](#changes-to-ports)
1413
- [Change to securityGroupFilters](#change-to-securitygroupfilters)
@@ -122,38 +121,6 @@ to set the `accessIPv4` field on Nova servers. This feature was not widely
122121
used, difficult to use, and could not be extended to support IPv6. It is
123122
removed without replacement.
124123

125-
#### Change to floatingIP
126-
127-
The `OpenStackMachineSpec.FloatingIP` field has moved to `OpenStackClusterSpec.Bastion.FloatingIP`.
128-
For example, if you had the following `OpenStackMachineTemplate`:
129-
130-
```yaml
131-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
132-
kind: OpenStackMachineTemplate
133-
metadata:
134-
name: ${CLUSTER_NAME}-md-0
135-
spec:
136-
template:
137-
spec:
138-
..
139-
floatingIP: "1.2.3.4"
140-
```
141-
142-
This will safely converted to use `Bastion.FloatingIP` when upgrading to version 0.8.
143-
144-
To use the new `Bastion.FloatingIP` field, here is an example:
145-
146-
```yaml
147-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
148-
kind: OpenStackCluster
149-
metadata:
150-
name: ${CLUSTER_NAME}
151-
spec:
152-
..
153-
bastion:
154-
floatingIP: "1.2.3.4"
155-
```
156-
157124
#### Change to securityGroups
158125

159126
`securityGroups` has been simplified by the removal of a separate filter parameter. It was previously:

0 commit comments

Comments
 (0)