Skip to content

Commit 7cf128f

Browse files
author
shiftstack-merge-bot
committed
2 parents 5319094 + 8fc6216 commit 7cf128f

37 files changed

+8790
-2953
lines changed

.github/workflows/pr-dependabot.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Check out code into the Go module directory
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
22+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # tag=v6.0.0
2323
- name: Calculate go version
2424
id: vars
2525
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
2626
- name: Set up Go
27-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
27+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # tag=v6.1.0
2828
with:
2929
go-version: ${{ steps.vars.outputs.go_version }}
30-
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # tag=v4.2.3
30+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # tag=v4.3.0
3131
name: Restore go cache
3232
with:
3333
path: |

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
- name: Set env
1818
run: echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
1919
- name: checkout code
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
20+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # tag=v6.0.0
2121
with:
2222
fetch-depth: 0
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@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
26+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # tag=v6.1.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@da05d552573ad5aba039eaac05058a918a7bf631 # tag=v2.2.2
40+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # tag=v2.5.0
4141
with:
4242
draft: true
4343
files: out/*

.github/workflows/security-scan.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Check out code
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
21+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # tag=v6.0.0
2222
with:
2323
ref: ${{ matrix.branch }}
2424
- name: Calculate go version
2525
id: vars
2626
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
2727
- name: Set up Go
28-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
28+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # tag=v6.1.0
2929
with:
3030
go-version: ${{ steps.vars.outputs.go_version }}
3131
- name: Run verify security target

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Build the manager binary
1616
ARG GO_VERSION
17-
FROM golang:${GO_VERSION} AS builder
17+
FROM golang:${GO_VERSION:-1.24.9} AS builder
1818
WORKDIR /workspace
1919

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

3333
# Copy the sources
3434
COPY ./ ./
@@ -40,10 +40,10 @@ ARG ldflags
4040

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

4848
# Production image
4949
FROM gcr.io/distroless/static:nonroot

Makefile

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ unexport GOPATH
2727
TRACE ?= 0
2828

2929
# Go
30-
GO_VERSION ?= 1.23.8
30+
GO_VERSION ?= 1.24.9
3131

3232
# Directories.
3333
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
@@ -69,6 +69,11 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
6969
GOTESTSUM := $(TOOLS_BIN_DIR)/gotestsum
7070
KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize
7171
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
72+
OPENAPI_GEN := $(TOOLS_BIN_DIR)/openapi-gen
73+
APPLYCONFIGURATION_GEN := $(TOOLS_BIN_DIR)/applyconfiguration-gen
74+
CLIENT_GEN := $(TOOLS_BIN_DIR)/client-gen
75+
LISTER_GEN := $(TOOLS_BIN_DIR)/lister-gen
76+
INFORMER_GEN := $(TOOLS_BIN_DIR)/informer-gen
7277
RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
7378
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup-envtest
7479
GEN_CRD_API_REFERENCE_DOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs
@@ -317,8 +322,66 @@ generate-controller-gen: $(CONTROLLER_GEN)
317322
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
318323

319324
.PHONY: generate-codegen
320-
generate-codegen: generate-controller-gen
321-
./hack/update-codegen.sh
325+
generate-codegen: generate-controller-gen $(OPENAPI_GEN) $(APPLYCONFIGURATION_GEN) $(CLIENT_GEN) $(LISTER_GEN) $(INFORMER_GEN)
326+
@echo "** Generating OpenAPI definitions **"
327+
# The package list includes:
328+
# - CAPO's own API packages (v1alpha1, v1alpha7, v1beta1) that have // +k8s:openapi-gen= markers
329+
# - Dependency packages from CAPI and k8s.io that are referenced by CAPO's APIs
330+
# - Base k8s.io/apimachinery packages
331+
$(OPENAPI_GEN) \
332+
--go-header-file=./hack/boilerplate.go.txt \
333+
--output-file=zz_generated.openapi.go \
334+
--output-dir=./cmd/models-schema \
335+
--output-pkg=main \
336+
--report-filename=./api_violations.report \
337+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1 \
338+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7 \
339+
sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 \
340+
sigs.k8s.io/cluster-api/api/v1beta1 \
341+
k8s.io/api/core/v1 \
342+
k8s.io/apimachinery/pkg/apis/meta/v1 \
343+
k8s.io/apimachinery/pkg/runtime \
344+
k8s.io/apimachinery/pkg/version
345+
@echo "** Generating openapi.json **"
346+
go run ./cmd/models-schema | jq > ./openapi.json
347+
@echo "** Generating applyconfiguration code **"
348+
$(APPLYCONFIGURATION_GEN) \
349+
--go-header-file=./hack/boilerplate.go.txt \
350+
--output-dir=./pkg/generated/applyconfiguration \
351+
--output-pkg=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/applyconfiguration \
352+
--openapi-schema=./openapi.json \
353+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1 \
354+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7 \
355+
sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1
356+
@echo "** Generating clientset code **"
357+
$(CLIENT_GEN) \
358+
--go-header-file=./hack/boilerplate.go.txt \
359+
--output-dir=./pkg/generated/clientset \
360+
--output-pkg=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/clientset \
361+
--clientset-name=clientset \
362+
--input-base=sigs.k8s.io/cluster-api-provider-openstack \
363+
--apply-configuration-package=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/applyconfiguration \
364+
--input=api/v1alpha1 \
365+
--input=api/v1alpha7 \
366+
--input=api/v1beta1
367+
@echo "** Generating lister code **"
368+
$(LISTER_GEN) \
369+
--go-header-file=./hack/boilerplate.go.txt \
370+
--output-dir=./pkg/generated/listers \
371+
--output-pkg=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/listers \
372+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1 \
373+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7 \
374+
sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1
375+
@echo "** Generating informer code **"
376+
$(INFORMER_GEN) \
377+
--go-header-file=./hack/boilerplate.go.txt \
378+
--output-dir=./pkg/generated/informers \
379+
--output-pkg=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/informers \
380+
--versioned-clientset-package=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/clientset/clientset \
381+
--listers-package=sigs.k8s.io/cluster-api-provider-openstack/pkg/generated/listers \
382+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1 \
383+
sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7 \
384+
sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1
322385

323386
.PHONY: generate-conversion-gen
324387
generate-conversion-gen: $(CONVERSION_GEN)
@@ -517,6 +580,8 @@ templates/cluster-template-%.yaml: kustomize/v1beta1/% $(KUSTOMIZE) FORCE
517580
.PHONY: release-templates
518581
release-templates: $(RELEASE_DIR) templates ## Generate release templates
519582
cp templates/cluster-template*.yaml $(RELEASE_DIR)/
583+
cp templates/clusterclass*.yaml $(RELEASE_DIR)/
584+
cp templates/image-template*.yaml $(RELEASE_DIR)/
520585

521586
IMAGE_PATCH_DIR := $(ARTIFACTS)/image-patch
522587

OWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ emeritus_approvers:
2121
- chrischdi
2222
- tobiasgiese
2323
- seanschneeweiss
24+
- jichenjc
25+
- mdbooth

OWNERS_ALIASES

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ aliases:
2121
cluster-api-openstack-maintainers:
2222
- emilienm
2323
- lentzi90
24-
- mdbooth
2524
cluster-api-openstack-reviewers:
26-
cluster-api-openstack-emeritus-maintainers:
27-
- jichenjc
25+
- bnallapeta
26+
- smoshiur1237

cloudbuild.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ options:
44
substitution_option: ALLOW_LOOSE
55
machineType: 'N1_HIGHCPU_8'
66
steps:
7-
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241229-5dc092c636'
8-
entrypoint: make
9-
env:
10-
- DOCKER_CLI_EXPERIMENTAL=enabled
11-
- TAG=$_GIT_TAG
12-
- PULL_BASE_REF=$_PULL_BASE_REF
13-
- DOCKER_BUILDKIT=1
14-
args:
15-
- release-staging
7+
# To check if the image can handle the build, you can try it like this:
8+
# docker run --rm -it -v $(pwd):/workspace gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:${TAG}
9+
# make clean # make sure we have something to build
10+
# make staging-manifests
11+
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20250116-2a05ea7e3d'
12+
entrypoint: make
13+
env:
14+
- DOCKER_CLI_EXPERIMENTAL=enabled
15+
- TAG=$_GIT_TAG
16+
- PULL_BASE_REF=$_PULL_BASE_REF
17+
- DOCKER_BUILDKIT=1
18+
args:
19+
- release-staging
1620
substitutions:
1721
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
1822
# can be used as a substitution

config/webhook/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
resources:
22
- manifests.yaml
33
- service.yaml
4-
5-
configurations:
6-
- kustomizeconfig.yaml

config/webhook/kustomizeconfig.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)