Skip to content

Commit 86a2308

Browse files
committed
Move FloatingIP to Bastion spec
1 parent 5968640 commit 86a2308

12 files changed

+37
-44
lines changed

api/v1alpha5/conversion.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,3 +437,7 @@ func Convert_v1alpha5_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(
437437
func Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in *infrav1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error {
438438
return autoConvert_v1alpha7_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in, out, s)
439439
}
440+
441+
func Convert_v1alpha7_Bastion_To_v1alpha5_Bastion(in *infrav1.Bastion, out *Bastion, s conversion.Scope) error {
442+
return autoConvert_v1alpha7_Bastion_To_v1alpha5_Bastion(in, out, s)
443+
}

api/v1alpha5/zz_generated.conversion.go

Lines changed: 2 additions & 7 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,3 +659,7 @@ func Convert_v1alpha6_OpenStackClusterStatus_To_v1alpha7_OpenStackClusterStatus(
659659
func Convert_v1alpha7_OpenStackMachineSpec_To_v1alpha6_OpenStackMachineSpec(in *infrav1.OpenStackMachineSpec, out *OpenStackMachineSpec, s apiconversion.Scope) error {
660660
return autoConvert_v1alpha7_OpenStackMachineSpec_To_v1alpha6_OpenStackMachineSpec(in, out, s)
661661
}
662+
663+
func Convert_v1alpha7_Bastion_To_v1alpha6_Bastion(in *infrav1.Bastion, out *Bastion, s apiconversion.Scope) error {
664+
return autoConvert_v1alpha7_Bastion_To_v1alpha6_Bastion(in, out, s)
665+
}

api/v1alpha6/zz_generated.conversion.go

Lines changed: 7 additions & 12 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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ 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-
6763
// The names of the security groups to assign to the instance
6864
SecurityGroups []SecurityGroupFilter `json:"securityGroups,omitempty"`
6965

api/v1alpha7/types.go

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

345345
//+optional
346346
AvailabilityZone string `json:"availabilityZone,omitempty"`
347+
348+
// The floatingIP which will be associated to the bastion machine.
349+
// The floatingIP should have been created and hasn't been associated.
350+
//+optional
351+
FloatingIP string `json:"floatingIP,omitempty"`
347352
}
348353

349354
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,6 +3767,11 @@ spec:
37673767
type: string
37683768
enabled:
37693769
type: boolean
3770+
floatingIP:
3771+
description: The floatingIP which will be associated to the bastion
3772+
machine. The floatingIP should have been created and hasn't
3773+
been associated.
3774+
type: string
37703775
instance:
37713776
description: Instance for the bastion itself
37723777
properties:
@@ -3842,11 +3847,6 @@ spec:
38423847
description: The flavor reference for the flavor for your
38433848
server instance.
38443849
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,6 +1607,11 @@ spec:
16071607
type: string
16081608
enabled:
16091609
type: boolean
1610+
floatingIP:
1611+
description: The floatingIP which will be associated to
1612+
the bastion machine. The floatingIP should have been
1613+
created and hasn't been associated.
1614+
type: string
16101615
instance:
16111616
description: Instance for the bastion itself
16121617
properties:
@@ -1688,11 +1693,6 @@ spec:
16881693
description: The flavor reference for the flavor for
16891694
your server instance.
16901695
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: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,11 +1226,6 @@ 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
12341229
identityRef:
12351230
description: IdentityRef is a reference to a identity to be used when
12361231
reconciling this cluster

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,11 +1030,6 @@ 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
10381033
identityRef:
10391034
description: IdentityRef is a reference to a identity to be
10401035
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.Instance.FloatingIP)
362+
fp, err := networkingService.GetOrCreateFloatingIP(openStackCluster, openStackCluster, clusterName, openStackCluster.Spec.Bastion.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/topics/crd-changes/v1alpha6-to-v1alpha7.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ known to cause some issues in some environments.
258258

259259
### `OpenStackCluster`
260260

261+
#### ⚠️ Change to floatingIP
262+
263+
The `floatingIP` field has moved from the `OpenStackMachineSpec` to the `OpenStackClusterSpec` into the `Bastion` spec.
264+
261265
#### Change to externalRouterIPs.subnet
262266

263267
The `uuid` field is renamed to `id`, and all fields from `filter` are moved directly into the `subnet`.

0 commit comments

Comments
 (0)