Skip to content

Commit 9d520c4

Browse files
author
shiftstack-merge-bot
committed
2 parents 23512b6 + d0a76bf commit 9d520c4

15 files changed

+314
-34
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
permissions:
10+
contents: write # Allow to create a release.
11+
12+
jobs:
13+
build:
14+
name: create draft release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set env
18+
run: echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
19+
- name: checkout code
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
21+
with:
22+
fetch-depth: 0
23+
- name: Calculate go version
24+
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
25+
- name: Set up Go
26+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # tag=v5.1.0
27+
with:
28+
go-version: ${{ env.go_version }}
29+
- name: generate release artifacts
30+
run: |
31+
make release
32+
- name: generate release notes
33+
# Ignore failures for release-notes generation so they could still get
34+
# generated manually before publishing.
35+
run: |
36+
make generate-release-notes || echo "Failed to generate release notes" >> _releasenotes/${{ env.RELEASE_TAG }}.md
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
- name: Release
40+
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # tag=v2.1.0
41+
with:
42+
draft: true
43+
files: out/*
44+
body_path: _releasenotes/${{ env.RELEASE_TAG }}.md

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ cscope.*
7474
*.test
7575
/hack/.test-cmd-auth
7676

77+
# Generated release notes
78+
_releasenotes
79+
7780
# JUnit test output from ginkgo e2e tests
7881
/junit*.xml
7982

Makefile

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export GOTOOLCHAIN=go1.22.8
2525
export GO111MODULE=on
2626
unexport GOPATH
2727

28+
# Go
29+
GO_VERSION ?= 1.22.7
30+
2831
# Directories.
2932
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
3033
TOOLS_DIR := hack/tools
@@ -359,8 +362,25 @@ staging-manifests:
359362
##@ Release
360363
## --------------------------------------
361364

365+
ifneq (,$(findstring -,$(RELEASE_TAG)))
366+
PRE_RELEASE=true
367+
endif
368+
PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null)
369+
## set by Prow, ref name of the base branch, e.g., main
370+
RELEASE_DIR := out
371+
RELEASE_NOTES_DIR := _releasenotes
372+
373+
.PHONY: $(RELEASE_DIR)
362374
$(RELEASE_DIR):
363-
mkdir -p $@
375+
mkdir -p $(RELEASE_DIR)/
376+
377+
.PHONY: $(RELEASE_NOTES_DIR)
378+
$(RELEASE_NOTES_DIR):
379+
mkdir -p $(RELEASE_NOTES_DIR)/
380+
381+
.PHONY: $(BUILD_DIR)
382+
$(BUILD_DIR):
383+
@mkdir -p $(BUILD_DIR)
364384

365385
.PHONY: list-staging-releases
366386
list-staging-releases: ## List staging images for image promotion
@@ -435,9 +455,14 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
435455
release-alias-tag: # Adds the tag to the last build tag.
436456
gcloud container images add-tag -q $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
437457

438-
.PHONY: release-notes
439-
release-notes: $(RELEASE_NOTES) ## Generate release notes
440-
$(RELEASE_NOTES) $(RELEASE_NOTES_ARGS)
458+
.PHONY: generate-release-notes ## Generate release notes
459+
generate-release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
460+
# Reset the file
461+
echo -n > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
462+
if [ -n "${PRE_RELEASE}" ]; then \
463+
echo -e ":rotating_light: This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/issues/new/choose).\n" >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md; \
464+
fi
465+
"$(RELEASE_NOTES)" --from=$(PREVIOUS_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
441466

442467
.PHONY: templates
443468
templates: ## Generate cluster templates
@@ -557,3 +582,12 @@ compile-e2e: ## Test e2e compilation
557582

558583
.PHONY: FORCE
559584
FORCE:
585+
586+
## --------------------------------------
587+
## Helpers
588+
## --------------------------------------
589+
590+
##@ helpers:
591+
592+
go-version: ## Print the go version we use to compile our binaries and images
593+
@echo $(GO_VERSION)

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

RELEASE.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ The content of the release notes differs depending on the type of release, speci
7070
for review and the promotion of the image.
7171
1. Run `make release` to build artifacts to be attached to the GitHub release.
7272
1. Generate and finalize the release notes and save them for the next step.
73-
- Run `make release-notes RELEASE_NOTES_ARGS="--from <tag>"`.
74-
- Depending on the type of release, substitute `<tag>` with the following:
75-
- Stable releases: tag of the last stable release
76-
- Pre-releases*: tag of the latest pre-release (or last stable release if there isn't one)
73+
- Run `make release-notes`.
7774
- Pay close attention to the `## :question: Sort these by hand` section, as it contains items that need to be manually sorted.
7875
1. Create a draft release in GitHub based on the tag created above
7976
- Name the release `Release [VERSION]` where VERSION is the full version string.

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: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ func (r *OpenStackClusterReconciler) reconcileDelete(ctx context.Context, scope
152152
// A bastion may have been created if cluster initialisation previously reached populating the network status
153153
// We attempt to delete it even if no status was written, just in case
154154
if openStackCluster.Status.Network != nil {
155-
// Attempt to resolve bastion resources before delete. We don't need to worry about starting if the resources have changed on update.
155+
// Attempt to resolve bastion resources before delete.
156+
// Even if we fail, we need to continue with the deletion or risk getting stuck.
157+
// For example, if the image doesn't exist, we do not have a bastion.
156158
if _, err := resolveBastionResources(scope, clusterResourceName, openStackCluster); err != nil {
157-
return reconcile.Result{}, err
159+
scope.Logger().Info("Failed to resolve bastion, continuing.", "error", err)
158160
}
159161

160162
if err := deleteBastion(scope, cluster, openStackCluster); err != nil {
@@ -664,14 +666,19 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
664666

665667
// Filter out only relevant subnets specified by the spec
666668
lbNetStatus.Subnets = []infrav1.Subnet{}
667-
for _, s := range lbSpec.Subnets {
669+
for i := range lbSpec.Subnets {
670+
s := lbSpec.Subnets[i]
668671
matchFound := false
669672
for _, subnetID := range lbNet.Subnets {
670-
if s.ID != nil && subnetID == *s.ID {
673+
subnet, err := networkingService.GetSubnetByParam(&s)
674+
if s.ID != nil && subnetID == *s.ID && err == nil {
671675
matchFound = true
672676
lbNetStatus.Subnets = append(
673677
lbNetStatus.Subnets, infrav1.Subnet{
674-
ID: *s.ID,
678+
ID: subnet.ID,
679+
Name: subnet.Name,
680+
CIDR: subnet.CIDR,
681+
Tags: subnet.Tags,
675682
})
676683
}
677684
}
@@ -680,6 +687,8 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
680687
return fmt.Errorf("no subnet match was found in the specified network (specified subnet: %v, available subnets: %v)", s, lbNet.Subnets)
681688
}
682689
}
690+
691+
openStackCluster.Status.APIServerLoadBalancer.LoadBalancerNetwork = lbNetStatus
683692
}
684693
}
685694

hack/ci/cloud-init/controller.yaml.tpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
VERBOSE=True
1313
LOG_COLOR=True
1414

15+
# Host tuning
16+
ENABLE_SYSCTL_MEM_TUNING="True"
17+
ENABLE_SYSCTL_NET_TUNING="True"
18+
ENABLE_ZSWAP="True"
19+
1520
# Octavia
1621
enable_plugin octavia https://github.com/openstack/octavia stable/${OPENSTACK_RELEASE}
1722
enable_plugin octavia-dashboard https://github.com/openstack/octavia-dashboard stable/${OPENSTACK_RELEASE}
@@ -43,6 +48,14 @@
4348
OVN_L3_CREATE_PUBLIC_NETWORK="True"
4449
Q_AGENT="ovn"
4550

51+
# WORKAROUND:
52+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/issues/2320
53+
# OVN built from source using LTS versions. Should be removed once OVS is more stable without the pin.
54+
# https://opendev.org/openstack/neutron/src/commit/83de306105f9329e24c97c4af6c3886de20e7d70/zuul.d/tempest-multinode.yaml#L603-L604
55+
OVN_BUILD_FROM_SOURCE=True
56+
OVN_BRANCH=branch-24.03
57+
OVS_BRANCH=branch-3.3
58+
4659
# Octavia
4760
ENABLED_SERVICES+=,octavia,o-api,o-cw,o-hm,o-hk,o-da
4861

@@ -89,6 +102,12 @@
89102
# query_placement_for_availability_zone is the default from Xena
90103
query_placement_for_availability_zone = True
91104

105+
[workarounds]
106+
# FIXME(stephenfin): This is temporary while we get to the bottom of
107+
# https://bugs.launchpad.net/nova/+bug/2091114 It should not be kept after
108+
# we bump to 2025.1
109+
disable_deep_image_inspection = True
110+
92111
[[post-config|$CINDER_CONF]]
93112
[DEFAULT]
94113
storage_availability_zone = ${PRIMARY_AZ}

hack/ci/cloud-init/worker.yaml.tpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
VERBOSE=True
1212
LOG_COLOR=True
1313

14+
# Host tuning
15+
ENABLE_SYSCTL_MEM_TUNING="True"
16+
ENABLE_SYSCTL_NET_TUNING="True"
17+
ENABLE_ZSWAP="True"
18+
1419
DATABASE_PASSWORD=secretdatabase
1520
RABBIT_PASSWORD=secretrabbit
1621
ADMIN_PASSWORD=secretadmin
@@ -39,6 +44,14 @@
3944
Q_ML2_PLUGIN_MECHANISM_DRIVERS="ovn,logger"
4045
Q_AGENT="ovn"
4146

47+
# WORKAROUND:
48+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/issues/2320
49+
# OVN built from source using LTS versions. Should be removed once OVS is more stable without the pin.
50+
# https://opendev.org/openstack/neutron/src/commit/83de306105f9329e24c97c4af6c3886de20e7d70/zuul.d/tempest-multinode.yaml#L603-L604
51+
OVN_BUILD_FROM_SOURCE=True
52+
OVN_BRANCH=branch-24.03
53+
OVS_BRANCH=branch-3.3
54+
4255
# Additional services
4356
ENABLED_SERVICES+=${OPENSTACK_ADDITIONAL_SERVICES}
4457
DISABLED_SERVICES+=${OPENSTACK_DISABLED_SERVICES}
@@ -47,6 +60,12 @@
4760
[DEFAULT]
4861
cpu_allocation_ratio = 2.0
4962

63+
[workarounds]
64+
# FIXME(stephenfin): This is temporary while we get to the bottom of
65+
# https://bugs.launchpad.net/nova/+bug/2091114 It should not be kept after
66+
# we bump to 2025.1
67+
disable_deep_image_inspection = True
68+
5069
[[post-config|$CINDER_CONF]]
5170
[DEFAULT]
5271
storage_availability_zone = ${SECONDARY_AZ}

hack/ci/create_devstack.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ source "${scriptdir}/${RESOURCE_TYPE}.sh"
3131

3232
CLUSTER_NAME=${CLUSTER_NAME:-"capo-e2e"}
3333

34-
OPENSTACK_RELEASE=${OPENSTACK_RELEASE:-"2023.2"}
34+
OPENSTACK_RELEASE=${OPENSTACK_RELEASE:-"2024.2"}
3535
OPENSTACK_ENABLE_HORIZON=${OPENSTACK_ENABLE_HORIZON:-"false"}
3636

3737
# Devstack will create a provider network using this range
@@ -47,6 +47,9 @@ PRIVATE_NETWORK_CIDR=${PRIVATE_NETWORK_CIDR:-"10.0.3.0/24"}
4747
CONTROLLER_IP=${CONTROLLER_IP:-"10.0.3.15"}
4848
WORKER_IP=${WORKER_IP:-"10.0.3.16"}
4949

50+
SKIP_INIT_INFRA=${SKIP_INIT_INFRA:-}
51+
SKIP_SECONDARY_AZ=${SKIP_SECONDARY_AZ:-}
52+
5053
PRIMARY_AZ=testaz1
5154
SECONDARY_AZ=testaz2
5255

@@ -273,7 +276,11 @@ function main() {
273276
# is available, and wait if it is not.
274277
#
275278
# For efficiency, tests which require multi-AZ SHOULD run as late as possible.
276-
create_worker
279+
if [[ -n "${SKIP_SECONDARY_AZ:-}" ]]; then
280+
echo "Skipping worker creation..."
281+
else
282+
create_worker
283+
fi
277284

278285
public_ip=$(get_public_ip)
279286
cat << EOF > "${REPO_ROOT_ABSOLUTE}/clouds.yaml"

hack/ci/gce-project.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function create_vm {
9595
--zone "$GCP_ZONE" \
9696
--enable-nested-virtualization \
9797
--image-project ubuntu-os-cloud \
98-
--image-family ubuntu-2204-lts \
99-
--boot-disk-size 200G \
98+
--image-family ubuntu-2404-lts-amd64 \
99+
--boot-disk-size 500G \
100100
--boot-disk-type pd-ssd \
101101
--can-ip-forward \
102102
--tags http-server,https-server,novnc,openstack-apis \

0 commit comments

Comments
 (0)