Skip to content

Commit b0f0dc4

Browse files
Merge pull request #337 from shiftstack/merge-bot-release-4.18
OCPBUGS-44458: Merge https://github.com/kubernetes-sigs/cluster-api-provider-openstack:release-0.11 into release-4.18
2 parents 9884985 + 2f93ff9 commit b0f0dc4

File tree

768 files changed

+68786
-28040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

768 files changed

+68786
-28040
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@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # tag=v5.1.0
27+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.0
2828
with:
2929
go-version: ${{ steps.vars.outputs.go_version }}
30-
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # tag=v4.1.2
30+
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # tag=v4.2.0
3131
name: Restore go cache
3232
with:
3333
path: |

.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@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.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@7b4da11513bf3f43f9999e90eabced41ab8bb048 # tag=v2.2.0
41+
with:
42+
draft: true
43+
files: out/*
44+
body_path: _releasenotes/${{ env.RELEASE_TAG }}.md

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ out
4949
# Vscode files
5050
.vscode
5151

52+
# Zed files
53+
.zed_server
54+
5255
# This is where the result of the go build goes
5356
/output*/
5457
/_output*/
@@ -74,6 +77,9 @@ cscope.*
7477
*.test
7578
/hack/.test-cmd-auth
7679

80+
# Generated release notes
81+
_releasenotes
82+
7783
# JUnit test output from ginkgo e2e tests
7884
/junit*.xml
7985

Makefile

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ include $(ROOT_DIR_RELATIVE)/common.mk
2323
export GO111MODULE=on
2424
unexport GOPATH
2525

26+
# Go
27+
GO_VERSION ?= 1.22.7
28+
2629
# Directories.
2730
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
2831
TOOLS_DIR := hack/tools
@@ -206,19 +209,18 @@ e2e-image: docker-build
206209

207210
# Pull all the images references in test/e2e/data/e2e_conf.yaml
208211
test-e2e-image-prerequisites:
209-
docker pull gcr.io/k8s-staging-cluster-api/cluster-api-controller:v1.6.0
210-
docker pull gcr.io/k8s-staging-cluster-api/kubeadm-bootstrap-controller:v1.6.0
211-
docker pull gcr.io/k8s-staging-cluster-api/kubeadm-control-plane-controller:v1.6.0
212-
docker pull quay.io/jetstack/cert-manager-cainjector:v1.12.1
213-
docker pull quay.io/jetstack/cert-manager-webhook:v1.12.1
214-
docker pull quay.io/jetstack/cert-manager-controller:v1.12.1
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
215215

216216
CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
217217
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
218-
CONFORMANCE_GINKGO_ARGS ?= -stream
219218
.PHONY: test-conformance
220219
test-conformance: $(GINKGO) e2e-prerequisites ## Run clusterctl based conformance test on workload cluster (requires Docker).
221-
time $(GINKGO) -trace -show-node-events -v -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) ./test/e2e/suites/conformance/... -- -config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" --data-folder="$(E2E_DATA_DIR)" $(CONFORMANCE_E2E_ARGS)
220+
time $(GINKGO) -trace -show-node-events -v -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) \
221+
./test/e2e/suites/conformance/... -- \
222+
-config-path="$(E2E_CONF_PATH)" -artifacts-folder="$(ARTIFACTS)" \
223+
--data-folder="$(E2E_DATA_DIR)" $(CONFORMANCE_E2E_ARGS)
222224

223225
test-conformance-fast: ## Run clusterctl based conformance test on workload cluster (requires Docker) using a subset of the conformance suite in parallel.
224226
$(MAKE) test-conformance CONFORMANCE_E2E_ARGS="-kubetest.config-file=$(KUBETEST_FAST_CONF_PATH) -kubetest.ginkgo-nodes=5 $(E2E_ARGS)"
@@ -394,8 +396,25 @@ staging-manifests:
394396
##@ Release
395397
## --------------------------------------
396398

399+
ifneq (,$(findstring -,$(RELEASE_TAG)))
400+
PRE_RELEASE=true
401+
endif
402+
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)
403+
## set by Prow, ref name of the base branch, e.g., main
404+
RELEASE_DIR := out
405+
RELEASE_NOTES_DIR := _releasenotes
406+
407+
.PHONY: $(RELEASE_DIR)
397408
$(RELEASE_DIR):
398-
mkdir -p $@
409+
mkdir -p $(RELEASE_DIR)/
410+
411+
.PHONY: $(RELEASE_NOTES_DIR)
412+
$(RELEASE_NOTES_DIR):
413+
mkdir -p $(RELEASE_NOTES_DIR)/
414+
415+
.PHONY: $(BUILD_DIR)
416+
$(BUILD_DIR):
417+
@mkdir -p $(BUILD_DIR)
399418

400419
.PHONY: list-staging-releases
401420
list-staging-releases: ## List staging images for image promotion
@@ -470,9 +489,14 @@ upload-gh-artifacts: $(GH) ## Upload artifacts to Github release
470489
release-alias-tag: # Adds the tag to the last build tag.
471490
gcloud container images add-tag -q $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
472491

473-
.PHONY: release-notes
474-
release-notes: $(RELEASE_NOTES) ## Generate release notes
475-
$(RELEASE_NOTES) $(RELEASE_NOTES_ARGS)
492+
.PHONY: generate-release-notes ## Generate release notes
493+
generate-release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
494+
# Reset the file
495+
echo -n > $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
496+
if [ -n "${PRE_RELEASE}" ]; then \
497+
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; \
498+
fi
499+
"$(RELEASE_NOTES)" --from=$(PREVIOUS_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
476500

477501
.PHONY: templates
478502
templates: ## Generate cluster templates
@@ -597,3 +621,12 @@ compile-e2e: ## Test e2e compilation
597621

598622
.PHONY: FORCE
599623
FORCE:
624+
625+
## --------------------------------------
626+
## Helpers
627+
## --------------------------------------
628+
629+
##@ helpers:
630+
631+
go-version: ## Print the go version we use to compile our binaries and images
632+
@echo $(GO_VERSION)

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.

api/v1beta1/openstackcluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const (
3131
)
3232

3333
// OpenStackClusterSpec defines the desired state of OpenStackCluster.
34+
// +kubebuilder:validation:XValidation:rule="has(self.disableExternalNetwork) && self.disableExternalNetwork ? !has(self.bastion) || !has(self.bastion.floatingIP) : true",message="bastion floating IP cannot be set when disableExternalNetwork is true"
35+
// +kubebuilder:validation:XValidation:rule="has(self.disableExternalNetwork) && self.disableExternalNetwork ? has(self.disableAPIServerFloatingIP) && self.disableAPIServerFloatingIP : true",message="disableAPIServerFloatingIP cannot be false when disableExternalNetwork is true"
3436
type OpenStackClusterSpec struct {
3537
// ManagedSubnets describe OpenStack Subnets to be created. Cluster actuator will create a network,
3638
// subnets with the defined CIDR, and a router connected to these subnets. Currently only one IPv4

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

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

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

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

controllers/openstackcluster_controller.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,11 @@ func (r *OpenStackClusterReconciler) reconcileBastion(ctx context.Context, scope
395395
return nil, err
396396
}
397397

398-
return bastionAddFloatingIP(openStackCluster, clusterResourceName, port, networkingService)
398+
if !ptr.Deref(openStackCluster.Spec.DisableExternalNetwork, false) {
399+
return bastionAddFloatingIP(openStackCluster, clusterResourceName, port, networkingService)
400+
}
401+
402+
return nil, nil
399403
}
400404

401405
func bastionAddFloatingIP(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string, port *ports.Port, networkingService *networking.Service) (*reconcile.Result, error) {
@@ -798,9 +802,9 @@ func reconcileControlPlaneEndpoint(scope *scope.WithLogger, networkingService *n
798802
case openStackCluster.Spec.ControlPlaneEndpoint != nil && openStackCluster.Spec.ControlPlaneEndpoint.IsValid():
799803
host = openStackCluster.Spec.ControlPlaneEndpoint.Host
800804

801-
// API server load balancer is disabled, but floating IP is not. Create
805+
// API server load balancer is disabled, but external netowork and floating IP are not. Create
802806
// a floating IP to be attached directly to a control plane host.
803-
case !ptr.Deref(openStackCluster.Spec.DisableAPIServerFloatingIP, false):
807+
case !ptr.Deref(openStackCluster.Spec.DisableAPIServerFloatingIP, false) && !ptr.Deref(openStackCluster.Spec.DisableExternalNetwork, false):
804808
fp, err := networkingService.GetOrCreateFloatingIP(openStackCluster, openStackCluster, clusterResourceName, openStackCluster.Spec.APIServerFloatingIP)
805809
if err != nil {
806810
handleUpdateOSCError(openStackCluster, fmt.Errorf("floating IP cannot be got or created: %w", err), false)

controllers/openstackmachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ func (r *OpenStackMachineReconciler) reconcileAPIServerLoadBalancer(scope *scope
628628
conditions.MarkFalse(openStackMachine, infrav1.APIServerIngressReadyCondition, infrav1.LoadBalancerMemberErrorReason, clusterv1.ConditionSeverityError, "Reconciling load balancer member failed: %v", err)
629629
return fmt.Errorf("reconcile load balancer member: %w", err)
630630
}
631-
} else if !ptr.Deref(openStackCluster.Spec.DisableAPIServerFloatingIP, false) {
631+
} else if !ptr.Deref(openStackCluster.Spec.DisableAPIServerFloatingIP, false) && !ptr.Deref(openStackCluster.Spec.DisableExternalNetwork, false) {
632632
var floatingIPAddress *string
633633
switch {
634634
case openStackCluster.Spec.ControlPlaneEndpoint != nil && openStackCluster.Spec.ControlPlaneEndpoint.IsValid():

0 commit comments

Comments
 (0)