Skip to content

Commit e4ad6b4

Browse files
author
shiftstack-merge-bot
committed
2 parents b0f0dc4 + 168df33 commit e4ad6b4

32 files changed

+1020
-459
lines changed

.github/workflows/pr-dependabot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
id: vars
2525
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
2626
- name: Set up Go
27-
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.0
27+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
2828
with:
2929
go-version: ${{ steps.vars.outputs.go_version }}
30-
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # tag=v4.2.0
30+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # tag=v4.2.3
3131
name: Restore go cache
3232
with:
3333
path: |

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Calculate go version
2424
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
2525
- name: Set up Go
26-
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.0
26+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
2727
with:
2828
go-version: ${{ env.go_version }}
2929
- name: generate release artifacts
@@ -37,7 +37,7 @@ jobs:
3737
env:
3838
GH_TOKEN: ${{ github.token }}
3939
- name: Release
40-
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # tag=v2.2.0
40+
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # tag=v2.2.2
4141
with:
4242
draft: true
4343
files: out/*

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ e2e-image: docker-build
209209

210210
# Pull all the images references in test/e2e/data/e2e_conf.yaml
211211
test-e2e-image-prerequisites:
212-
docker pull registry.k8s.io/cluster-api/cluster-api-controller:v1.8.6
213-
docker pull registry.k8s.io/cluster-api/kubeadm-bootstrap-controller:v1.8.6
214-
docker pull registry.k8s.io/cluster-api/kubeadm-control-plane-controller:v1.8.6
212+
docker pull registry.k8s.io/cluster-api/cluster-api-controller:v1.8.8
213+
docker pull registry.k8s.io/cluster-api/kubeadm-bootstrap-controller:v1.8.8
214+
docker pull registry.k8s.io/cluster-api/kubeadm-control-plane-controller:v1.8.8
215215

216216
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
217217
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)

OWNERS_ALIASES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ aliases:
2020
- vincepri
2121
cluster-api-openstack-maintainers:
2222
- emilienm
23-
- jichenjc
2423
- lentzi90
2524
- mdbooth
2625
cluster-api-openstack-reviewers:
26+
cluster-api-openstack-emeritus-maintainers:
27+
- jichenjc

cloudbuild-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ options:
44
substitution_option: ALLOW_LOOSE
55
machineType: 'N1_HIGHCPU_8'
66
steps:
7-
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
7+
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241229-5dc092c636'
88
entrypoint: make
99
env:
1010
- DOCKER_CLI_EXPERIMENTAL=enabled

cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ options:
44
substitution_option: ALLOW_LOOSE
55
machineType: 'N1_HIGHCPU_8'
66
steps:
7-
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
7+
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241229-5dc092c636'
88
entrypoint: make
99
env:
1010
- DOCKER_CLI_EXPERIMENTAL=enabled

controllers/openstackcluster_controller.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,11 +627,15 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
627627
for _, s := range lbSpec.Subnets {
628628
matchFound := false
629629
for _, subnetID := range lbNet.Subnets {
630-
if s.ID != nil && subnetID == *s.ID {
630+
subnet, err := networkingService.GetSubnetByParam(&s)
631+
if s.ID != nil && subnetID == *s.ID && err == nil {
631632
matchFound = true
632633
lbNetStatus.Subnets = append(
633634
lbNetStatus.Subnets, infrav1.Subnet{
634-
ID: *s.ID,
635+
ID: subnet.ID,
636+
Name: subnet.Name,
637+
CIDR: subnet.CIDR,
638+
Tags: subnet.Tags,
635639
})
636640
}
637641
}
@@ -640,6 +644,8 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
640644
return fmt.Errorf("no subnet match was found in the specified network (specified subnet: %v, available subnets: %v)", s, lbNet.Subnets)
641645
}
642646
}
647+
648+
openStackCluster.Status.APIServerLoadBalancer.LoadBalancerNetwork = lbNetStatus
643649
}
644650
}
645651

controllers/openstackmachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func (r *OpenStackMachineReconciler) reconcileMachineState(scope *scope.WithLogg
453453
// The other state is normal (for example, migrating, shutoff) but we don't want to proceed until it's ACTIVE
454454
// due to potential conflict or unexpected actions
455455
scope.Logger().Info("Waiting for instance to become ACTIVE", "id", openStackServer.Status.InstanceID, "status", openStackServer.Status.InstanceState)
456-
conditions.MarkUnknown(openStackMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotReadyReason, "Instance state is not handled: %v", openStackServer.Status.InstanceState)
456+
conditions.MarkUnknown(openStackMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotReadyReason, "Instance state is not handled: %v", ptr.Deref(openStackServer.Status.InstanceState, infrav1.InstanceStateUndefined))
457457

458458
return &ctrl.Result{RequeueAfter: waitForInstanceBecomeActiveToReconcile}
459459
}

controllers/openstackserver_controller.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func patchServer(ctx context.Context, patchHelper *patch.Helper, openStackServer
169169
return patchHelper.Patch(ctx, openStackServer, options...)
170170
}
171171

172-
func (r *OpenStackServerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, _ controller.Options) error {
172+
func (r *OpenStackServerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
173173
const imageRefPath = "spec.image.imageRef.name"
174174

175175
log := ctrl.LoggerFrom(ctx)
@@ -189,6 +189,7 @@ func (r *OpenStackServerReconciler) SetupWithManager(ctx context.Context, mgr ct
189189
}
190190

191191
return ctrl.NewControllerManagedBy(mgr).
192+
WithOptions(options).
192193
For(&infrav1alpha1.OpenStackServer{}).
193194
Watches(&orcv1alpha1.Image{},
194195
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, obj client.Object) []reconcile.Request {
@@ -418,11 +419,7 @@ func getOrCreateServerPorts(openStackServer *infrav1alpha1.OpenStackServer, netw
418419
}
419420
desiredPorts := resolved.Ports
420421

421-
if len(desiredPorts) == len(resources.Ports) {
422-
return nil
423-
}
424-
425-
if err := networkingService.CreatePorts(openStackServer, desiredPorts, resources); err != nil {
422+
if err := networkingService.EnsurePorts(openStackServer, desiredPorts, resources); err != nil {
426423
return fmt.Errorf("creating ports: %w", err)
427424
}
428425

@@ -602,6 +599,7 @@ func (r *OpenStackServerReconciler) getOrCreateIPAddressClaimForFloatingAddress(
602599
},
603600
},
604601
Finalizers: []string{infrav1.IPClaimMachineFinalizer},
602+
Labels: map[string]string{},
605603
},
606604
Spec: ipamv1.IPAddressClaimSpec{
607605
PoolRef: *poolRef,

controllers/openstackserver_controller_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ var listDefaultPorts = func(r *recorders) {
114114
}, nil)
115115
}
116116

117+
var listDefaultPortsWithID = func(r *recorders) {
118+
r.network.ListPort(ports.ListOpts{
119+
Name: openStackServerName + "-0",
120+
ID: portUUID,
121+
NetworkID: networkUUID,
122+
}).Return([]ports.Port{
123+
{
124+
ID: portUUID,
125+
},
126+
}, nil)
127+
}
128+
117129
var listDefaultPortsNotFound = func(r *recorders) {
118130
r.network.ListPort(ports.ListOpts{
119131
Name: openStackServerName + "-0",
@@ -479,6 +491,7 @@ func Test_OpenStackServerReconcileCreate(t *testing.T) {
479491
listDefaultPortsNotFound(r)
480492
createDefaultPort(r)
481493
listDefaultServerNotFound(r)
494+
listDefaultPortsNotFound(r)
482495
createDefaultServer(r)
483496
},
484497
},
@@ -500,6 +513,7 @@ func Test_OpenStackServerReconcileCreate(t *testing.T) {
500513
},
501514
expect: func(r *recorders) {
502515
listDefaultPorts(r)
516+
listDefaultPortsWithID(r)
503517
listDefaultServerFound(r)
504518
},
505519
},

0 commit comments

Comments
 (0)