Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
8a70d40
🌱 Update CAPI to v1.8.8
EmilienM Dec 22, 2024
ab9d8e9
Merge pull request #2342 from shiftstack/capi_bump_0.11
k8s-ci-robot Dec 30, 2024
fb27ecc
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Dec 30, 2024
69e2fec
Update generated code
dependabot[bot] Dec 30, 2024
a356cc3
Merge pull request #2348 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Dec 31, 2024
33bf02f
:seedling:(deps): Bump golang.org/x/crypto
dependabot[bot] Jan 6, 2025
3ab5fdc
Update generated code
dependabot[bot] Jan 6, 2025
7d3639b
Merge pull request #2351 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Jan 6, 2025
7404661
Add empty Labels map on new IPAddressClaim.ObjectMeta
mikaelgron Jan 8, 2025
1552d42
Merge pull request #2354 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 9, 2025
c45120d
:seedling:(deps): Bump softprops/action-gh-release
dependabot[bot] Jan 13, 2025
b1b91b4
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Jan 13, 2025
e59a7f7
Merge pull request #2359 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Jan 13, 2025
524ad95
Merge pull request #2360 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Jan 13, 2025
3c06579
fix: create lbaas in specified subnet
Dec 18, 2024
584613e
Merge pull request #2363 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 14, 2025
9686381
Update cloudbuild image
lentzi90 Jan 14, 2025
349d4b8
Merge pull request #2366 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 14, 2025
dc91eaa
Update OWNERS_ALIASES
EmilienM Jan 14, 2025
80d3717
Merge pull request #2372 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 15, 2025
6ceda08
:seedling:(deps): Bump actions/setup-go in the all-github-actions group
dependabot[bot] Jan 21, 2025
a7581da
Merge pull request #2382 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Jan 21, 2025
aa3898d
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Jan 21, 2025
fec1896
hack/tools: pin gengo/v2 to older & compatible version
EmilienM Jan 21, 2025
3f8b7fa
Run `make modules`
EmilienM Jan 21, 2025
08cc3b0
Run `make generate`
EmilienM Jan 21, 2025
57c9d63
Merge pull request #2385 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Jan 21, 2025
527d6f9
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 2 …
dependabot[bot] Jan 23, 2025
e3eac4c
Update generated code
dependabot[bot] Jan 23, 2025
35fa500
Merge pull request #2392 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Jan 23, 2025
5428853
Ensure that existing ports also have correct tags and trunks
Nov 15, 2024
cdc0b67
Only replace tags when needed
lentzi90 Dec 17, 2024
d75341e
Merge pull request #2396 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 24, 2025
c4c3aba
port/cleanup: support old bastion port name
EmilienM Jan 31, 2025
9cb2112
Merge pull request #2410 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jan 31, 2025
b1bcaab
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Feb 3, 2025
c43b045
Update generated code
dependabot[bot] Feb 3, 2025
dac1c72
Merge pull request #2413 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Feb 4, 2025
5ad1b17
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Feb 10, 2025
b1cbaec
Update generated code
dependabot[bot] Feb 10, 2025
e7ba500
Merge pull request #2422 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Feb 10, 2025
57d68c9
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Feb 17, 2025
fea49d2
Update generated code
dependabot[bot] Feb 17, 2025
de3fe09
Merge pull request #2427 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Feb 17, 2025
35592a3
:seedling:(deps): Bump actions/cache in the all-github-actions group
dependabot[bot] Feb 24, 2025
72985ba
Merge pull request #2436 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Feb 24, 2025
c867dbf
[release-0.11] 🌱 Bump golangci-lint to support go1.24
EmilienM Mar 5, 2025
8312b12
Fix a lint issue on image reconcile
EmilienM Mar 5, 2025
adeb821
Merge pull request #2451 from shiftstack/cilint-bump-0.11
k8s-ci-robot Mar 5, 2025
b78a009
:seedling:(deps): Bump actions/cache in the all-github-actions group
dependabot[bot] Mar 3, 2025
60f1ccd
Merge pull request #2439 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Mar 5, 2025
5eee818
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Mar 5, 2025
ec8699d
Update generated code
dependabot[bot] Mar 5, 2025
efa0259
go.mod: remove replace for github.com/prometheus/common
EmilienM Mar 5, 2025
09e5f08
Update generated code
dependabot[bot] Mar 5, 2025
86a0867
Merge pull request #2462 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Mar 5, 2025
2685cf0
Dereference the instance state
mikejoh Mar 5, 2025
c8f6183
Merge pull request #2466 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Mar 6, 2025
0eb8917
:seedling:(deps): bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Mar 17, 2025
a1aacd8
Update generated code
dependabot[bot] Mar 17, 2025
dcf91ab
Merge pull request #2487 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Mar 17, 2025
025a0bd
:seedling:(deps): Bump the all-github-actions group with 2 updates
dependabot[bot] Mar 24, 2025
5880244
Merge pull request #2492 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Mar 24, 2025
faf8512
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 2 …
dependabot[bot] Mar 25, 2025
261737a
Update generated code
dependabot[bot] Mar 25, 2025
bb1e59c
Merge pull request #2499 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Mar 25, 2025
7a17a78
fix openstackserver controller concurrency
okozachenko1203 Mar 28, 2025
19f074a
Merge pull request #2504 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Mar 28, 2025
42e4c25
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 2 …
dependabot[bot] Apr 7, 2025
1bf9853
Merge pull request #2509 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Apr 7, 2025
0fa8c8c
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Apr 14, 2025
6cbe92d
Update generated code
dependabot[bot] Apr 14, 2025
96693bf
Merge pull request #2513 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Apr 14, 2025
a1104c4
:seedling:(deps): bump softprops/action-gh-release
dependabot[bot] Apr 21, 2025
095cced
Merge pull request #2521 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot Apr 22, 2025
7157fdb
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Apr 30, 2025
026d904
Update generated code
dependabot[bot] Apr 30, 2025
4bd158a
Merge pull request #2529 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Apr 30, 2025
60f1805
allow switching from filter.name to id in openstackclusterspec networ…
okozachenko1203 Apr 16, 2025
bdfba15
Merge pull request #2541 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot May 12, 2025
2f49923
:seedling:(deps): Bump actions/setup-go in the all-github-actions group
dependabot[bot] May 12, 2025
168df33
Merge pull request #2545 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot May 12, 2025
eb09788
Add weekly security scan using govulncheck and trivy
lentzi90 May 6, 2025
536adc8
feat: use specified go version for docker build
Dec 18, 2024
db142b1
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] May 19, 2025
50efc21
Update generated code
dependabot[bot] May 19, 2025
57e1d20
Merge pull request #2553 from Nordix/lentzi90/release-0.11-security-scan
k8s-ci-robot May 20, 2025
85d8279
Bump go to 1.22.12
lentzi90 May 19, 2025
dfcf745
Add ignore file for trivy
lentzi90 May 21, 2025
71632c5
Merge pull request #2556 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot May 21, 2025
59667e1
Merge pull request #2557 from Nordix/lentzi90/release-0.11-security-scan
k8s-ci-robot May 21, 2025
82ec238
Build with go1.23.8
lentzi90 May 21, 2025
fd174bb
Merge pull request #2559 from Nordix/lentzi90/release-0.11-go-bump
k8s-ci-robot May 21, 2025
2187028
:seedling:(deps): Bump actions/setup-go in the all-github-actions group
dependabot[bot] May 26, 2025
f433b82
Merge pull request #2572 from kubernetes-sigs/dependabot/github_actio…
k8s-ci-robot May 26, 2025
3745c9e
:seedling:(deps): Bump the all-go-mod-patch-and-minor group across 3 …
dependabot[bot] Jun 2, 2025
c6ffd4e
Update generated code
dependabot[bot] Jun 2, 2025
585170b
Merge pull request #2580 from kubernetes-sigs/dependabot/go_modules/r…
k8s-ci-robot Jun 2, 2025
28a82f1
Add FlavorID to be set by openStackMachineSpecToOpenStackServerSpec
sirpaleet Jun 3, 2025
1154e42
Merge pull request #2586 from k8s-infra-cherrypick-robot/cherry-pick-…
k8s-ci-robot Jun 9, 2025
063b2f7
Merge remote-tracking branch 'k8s/release-0.11' into 4.18-sync-from-u…
mandre Jun 11, 2025
35b741c
Updating and vendoring go modules after an upstream merge
mandre Jun 11, 2025
4be4e67
CARRY: replace exportloopref linter by copyloopvar
mandre Jun 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/pr-dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.0
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
with:
go-version: ${{ steps.vars.outputs.go_version }}
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # tag=v4.2.0
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # tag=v4.2.3
name: Restore go cache
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Calculate go version
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # tag=v5.2.0
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
with:
go-version: ${{ env.go_version }}
- name: generate release artifacts
Expand All @@ -37,7 +37,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Release
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # tag=v2.2.0
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # tag=v2.2.2
with:
draft: true
files: out/*
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Weekly security scan

on:
schedule:
# Cron for every Monday at 9:12 UTC.
- cron: "12 9 * * 1"

# Remove all permissions from GITHUB_TOKEN except metadata.
permissions: {}

jobs:
scan:
strategy:
fail-fast: false
matrix:
branch: [main, release-0.12, release-0.11, release-0.10]
name: Trivy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
with:
ref: ${{ matrix.branch }}
- name: Calculate go version
id: vars
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
with:
go-version: ${{ steps.vars.outputs.go_version }}
- name: Run verify security target
run: make verify-security
4 changes: 4 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These require updating the go version to 1.23.
# According to govulncheck we are not using code that is affected by them anyway
CVE-2025-22870
CVE-2025-22872
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
# limitations under the License.

# Build the manager binary
FROM golang:1.22.0 as builder
ARG GO_VERSION
FROM golang:${GO_VERSION} AS builder
WORKDIR /workspace

# Run this with docker build --build_arg goproxy=$(go env GOPROXY) to override the goproxy
Expand All @@ -30,7 +31,7 @@ COPY orc/go.sum orc/go.sum
# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
go mod download

# Copy the sources
COPY ./ ./
Expand All @@ -42,10 +43,10 @@ ARG ldflags

# Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -ldflags "${ldflags} -extldflags '-static'" \
-o manager ${package}
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
go build -ldflags "${ldflags} -extldflags '-static'" \
-o manager ${package}

# Production image
FROM gcr.io/distroless/static:nonroot
Expand Down
58 changes: 50 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ include $(ROOT_DIR_RELATIVE)/common.mk
export GO111MODULE=on
unexport GOPATH

# Enables shell script tracing. Enable by running: TRACE=1 make <target>
TRACE ?= 0

# Go
GO_VERSION ?= 1.22.7
GO_VERSION ?= 1.23.8

# Directories.
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
TOOLS_DIR := hack/tools
BIN_DIR := bin
TOOLS_DIR_DEPS := $(TOOLS_DIR)/go.sum $(TOOLS_DIR)/go.mod $(TOOLS_DIR)/Makefile
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
TOOLS_BIN_DIR := $(TOOLS_DIR)/$(BIN_DIR)

BIN_DIR := bin
REPO_ROOT := $(shell git rev-parse --show-toplevel)
GH_REPO ?= kubernetes-sigs/cluster-api-provider-openstack
TEST_E2E_DIR := test/e2e
Expand All @@ -49,6 +52,13 @@ GO_APIDIFF_VER := v0.8.2
GO_APIDIFF_BIN := go-apidiff
GO_APIDIFF_PKG := github.com/joelanford/go-apidiff

# govulncheck
GOVULNCHECK_VER := v1.1.4
GOVULNCHECK_BIN := govulncheck
GOVULNCHECK_PKG := golang.org/x/vuln/cmd/govulncheck

TRIVY_VER := 0.49.1

# Binaries.
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
CONVERSION_GEN := $(TOOLS_BIN_DIR)/conversion-gen
Expand All @@ -63,6 +73,7 @@ RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup-envtest
GEN_CRD_API_REFERENCE_DOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs
GO_APIDIFF := $(TOOLS_BIN_DIR)/$(GO_APIDIFF_BIN)-$(GO_APIDIFF_VER)
GOVULNCHECK := $(TOOLS_BIN_DIR)/$(GOVULNCHECK_BIN)-$(GOVULNCHECK_VER)

# Kubebuilder
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.28.0
Expand Down Expand Up @@ -209,9 +220,9 @@ e2e-image: docker-build

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

CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH)
CONFORMANCE_E2E_ARGS += $(E2E_ARGS)
Expand Down Expand Up @@ -252,6 +263,12 @@ $(GO_APIDIFF_BIN): $(GO_APIDIFF)
$(GO_APIDIFF): # Build go-apidiff.
GOBIN=$(abspath $(TOOLS_BIN_DIR)) $(GO_INSTALL) $(GO_APIDIFF_PKG) $(GO_APIDIFF_BIN) $(GO_APIDIFF_VER)

.PHONY: $(GOVULNCHECK_BIN)
$(GOVULNCHECK_BIN): $(GOVULNCHECK) ## Build a local copy of govulncheck.

$(GOVULNCHECK): # Build govulncheck.
GOBIN=$(abspath $(TOOLS_BIN_DIR)) $(GO_INSTALL) $(GOVULNCHECK_PKG) $(GOVULNCHECK_BIN) $(GOVULNCHECK_VER)

## --------------------------------------
##@ Linting
## --------------------------------------
Expand Down Expand Up @@ -358,7 +375,7 @@ generate-api-docs-%: $(GEN_CRD_API_REFERENCE_DOCS) FORCE

.PHONY: docker-build
docker-build: ## Build the docker image for controller-manager
docker build -f Dockerfile --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)
docker build -f Dockerfile --build-arg GO_VERSION=$(GO_VERSION) --build-arg goproxy=$(GOPROXY) --build-arg ARCH=$(ARCH) --build-arg ldflags="$(LDFLAGS)" . -t $(CONTROLLER_IMG_TAG)

.PHONY: docker-push
docker-push: ## Push the docker image
Expand Down Expand Up @@ -579,8 +596,12 @@ clean-temporary: ## Remove all temporary files and folders
clean-release: ## Remove the release folder
rm -rf $(RELEASE_DIR)

.PHONY: clean-release-git
clean-release-git: ## Restores the git files usually modified during a release
git restore ./*manager_image_patch.yaml ./*manager_pull_policy.yaml

.PHONY: verify
verify: verify-boilerplate verify-modules verify-gen verify-orc
verify: verify-boilerplate verify-modules verify-gen verify-orc verify-govulncheck

.PHONY: verify-boilerplate
verify-boilerplate:
Expand All @@ -604,6 +625,27 @@ verify-gen: generate
verify-orc:
$(MAKE) -C $(REPO_ROOT)/orc verify-generated

.PHONY: verify-container-images
verify-container-images: ## Verify container images
TRACE=$(TRACE) ./hack/verify-container-images.sh $(TRIVY_VER)

.PHONY: verify-govulncheck
verify-govulncheck: $(GOVULNCHECK) ## Verify code for vulnerabilities
$(GOVULNCHECK) ./... && R1=$$? || R1=$$?; \
$(GOVULNCHECK) -C "$(TOOLS_DIR)" ./... && R2=$$? || R2=$$?; \
if [ "$$R1" -ne "0" ] || [ "$$R2" -ne "0" ]; then \
exit 1; \
fi

.PHONY: verify-security
verify-security: ## Verify code and images for vulnerabilities
$(MAKE) verify-container-images && R1=$$? || R1=$$?; \
$(MAKE) verify-govulncheck && R2=$$? || R2=$$?; \
if [ "$$R1" -ne "0" ] || [ "$$R2" -ne "0" ]; then \
echo "Check for vulnerabilities failed! There are vulnerabilities to be fixed"; \
exit 1; \
fi

.PHONY: vendor verify-vendoring
vendor:
go mod vendor
Expand Down
3 changes: 2 additions & 1 deletion OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ aliases:
- vincepri
cluster-api-openstack-maintainers:
- emilienm
- jichenjc
- lentzi90
- mdbooth
cluster-api-openstack-reviewers:
cluster-api-openstack-emeritus-maintainers:
- jichenjc
2 changes: 1 addition & 1 deletion cloudbuild-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options:
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241229-5dc092c636'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options:
substitution_option: ALLOW_LOOSE
machineType: 'N1_HIGHCPU_8'
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241229-5dc092c636'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
10 changes: 8 additions & 2 deletions controllers/openstackcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,15 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
for _, s := range lbSpec.Subnets {
matchFound := false
for _, subnetID := range lbNet.Subnets {
if s.ID != nil && subnetID == *s.ID {
subnet, err := networkingService.GetSubnetByParam(&s)
if s.ID != nil && subnetID == *s.ID && err == nil {
matchFound = true
lbNetStatus.Subnets = append(
lbNetStatus.Subnets, infrav1.Subnet{
ID: *s.ID,
ID: subnet.ID,
Name: subnet.Name,
CIDR: subnet.CIDR,
Tags: subnet.Tags,
})
}
}
Expand All @@ -640,6 +644,8 @@ func resolveLoadBalancerNetwork(openStackCluster *infrav1.OpenStackCluster, netw
return fmt.Errorf("no subnet match was found in the specified network (specified subnet: %v, available subnets: %v)", s, lbNet.Subnets)
}
}

openStackCluster.Status.APIServerLoadBalancer.LoadBalancerNetwork = lbNetStatus
}
}

Expand Down
3 changes: 2 additions & 1 deletion controllers/openstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func (r *OpenStackMachineReconciler) reconcileMachineState(scope *scope.WithLogg
// The other state is normal (for example, migrating, shutoff) but we don't want to proceed until it's ACTIVE
// due to potential conflict or unexpected actions
scope.Logger().Info("Waiting for instance to become ACTIVE", "id", openStackServer.Status.InstanceID, "status", openStackServer.Status.InstanceState)
conditions.MarkUnknown(openStackMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotReadyReason, "Instance state is not handled: %v", openStackServer.Status.InstanceState)
conditions.MarkUnknown(openStackMachine, infrav1.InstanceReadyCondition, infrav1.InstanceNotReadyReason, "Instance state is not handled: %v", ptr.Deref(openStackServer.Status.InstanceState, infrav1.InstanceStateUndefined))

return &ctrl.Result{RequeueAfter: waitForInstanceBecomeActiveToReconcile}
}
Expand All @@ -480,6 +480,7 @@ func openStackMachineSpecToOpenStackServerSpec(openStackMachineSpec *infrav1.Ope
AdditionalBlockDevices: openStackMachineSpec.AdditionalBlockDevices,
ConfigDrive: openStackMachineSpec.ConfigDrive,
Flavor: openStackMachineSpec.Flavor,
FlavorID: openStackMachineSpec.FlavorID,
IdentityRef: identityRef,
Image: openStackMachineSpec.Image,
RootVolume: openStackMachineSpec.RootVolume,
Expand Down
38 changes: 37 additions & 1 deletion controllers/openstackmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestOpenStackMachineSpecToOpenStackServerSpec(t *testing.T) {
},
},
{
name: "Test a OpenStackMachineSpec to OpenStackServerSpec conversion with an additional security group",
name: "Test an OpenStackMachineSpec to OpenStackServerSpec conversion with an additional security group",
spec: &infrav1.OpenStackMachineSpec{
Flavor: ptr.To(flavorName),
Image: image,
Expand All @@ -138,6 +138,42 @@ func TestOpenStackMachineSpecToOpenStackServerSpec(t *testing.T) {
UserDataRef: userData,
},
},
{
name: "Test an OpenStackMachineSpec to OpenStackServerSpec conversion with flavor and flavorID specified",
spec: &infrav1.OpenStackMachineSpec{
Flavor: ptr.To(flavorName),
FlavorID: ptr.To(flavorUUID),
Image: image,
SSHKeyName: sshKeyName,
},
want: &infrav1alpha1.OpenStackServerSpec{
Flavor: ptr.To(flavorName),
FlavorID: ptr.To(flavorUUID),
IdentityRef: identityRef,
Image: image,
SSHKeyName: sshKeyName,
Ports: portOpts,
Tags: tags,
UserDataRef: userData,
},
},
{
name: "Test an OpenStackMachineSpec to OpenStackServerSpec conversion with flavorID specified but not flavor",
spec: &infrav1.OpenStackMachineSpec{
FlavorID: ptr.To(flavorUUID),
Image: image,
SSHKeyName: sshKeyName,
},
want: &infrav1alpha1.OpenStackServerSpec{
FlavorID: ptr.To(flavorUUID),
IdentityRef: identityRef,
Image: image,
SSHKeyName: sshKeyName,
Ports: portOpts,
Tags: tags,
UserDataRef: userData,
},
},
}
for i := range tests {
tt := tests[i]
Expand Down
10 changes: 4 additions & 6 deletions controllers/openstackserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func patchServer(ctx context.Context, patchHelper *patch.Helper, openStackServer
return patchHelper.Patch(ctx, openStackServer, options...)
}

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

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

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

if len(desiredPorts) == len(resources.Ports) {
return nil
}

if err := networkingService.CreatePorts(openStackServer, desiredPorts, resources); err != nil {
if err := networkingService.EnsurePorts(openStackServer, desiredPorts, resources); err != nil {
return fmt.Errorf("creating ports: %w", err)
}

Expand Down Expand Up @@ -602,6 +599,7 @@ func (r *OpenStackServerReconciler) getOrCreateIPAddressClaimForFloatingAddress(
},
},
Finalizers: []string{infrav1.IPClaimMachineFinalizer},
Labels: map[string]string{},
},
Spec: ipamv1.IPAddressClaimSpec{
PoolRef: *poolRef,
Expand Down
Loading