Skip to content

Commit fc4c6ba

Browse files
authored
Merge pull request #29 from Mirantis/bot/upstream-sync
Sync with upstream/main
2 parents efd64e5 + d566848 commit fc4c6ba

File tree

125 files changed

+4081
-810
lines changed

Some content is hidden

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

125 files changed

+4081
-810
lines changed

.github/ISSUE_TEMPLATE/new_release.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Tasks for a new release `vX.Y.Z` of the Cluster API Provider OpenStack.
1111
For details, see [RELEASE.md](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/RELEASE.md).
1212

1313
- [ ] [When bumping `X` or `Y`] Create a new release branch called `release-X.Y`.
14+
- [ ] [When bumping `X` or `Y`] Add a new entry of new release branch to [depandabot.yml](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/.github/dependabot.yml).
15+
- [ ] [When bumping `X` or `Y`] Add a new entry of new release branch to [security-scan.yaml](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/.github/workflows/security-scan.yaml).
1416
- [ ] [When bumping `X` or `Y`] Add a new entry to [metadata.yaml](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/metadata.yaml)
1517
as [described in the CAPI book](https://cluster-api.sigs.k8s.io/clusterctl/provider-contract.html#metadata-yaml)
1618
on the release branch prior to release.

.github/dependabot.yml

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ updates:
1212
target-branch: main
1313
groups:
1414
all-github-actions:
15-
patterns: [ "*" ]
15+
patterns: ["*"]
1616
commit-message:
1717
prefix: ":seedling:"
1818
include: scope
@@ -30,8 +30,8 @@ updates:
3030
target-branch: main
3131
groups:
3232
all-go-mod-patch-and-minor:
33-
patterns: [ "*" ]
34-
update-types: [ "patch", "minor" ]
33+
patterns: ["*"]
34+
update-types: ["patch", "minor"]
3535
commit-message:
3636
prefix: ":seedling:"
3737
include: scope
@@ -44,27 +44,21 @@ updates:
4444
update-types: ["version-update:semver-major", "version-update:semver-minor"]
4545
- dependency-name: "sigs.k8s.io/controller-tools"
4646
update-types: ["version-update:semver-major", "version-update:semver-minor"]
47-
# We will need k8s v0.31.3 to bump structured-merge-diff to v4.4.2 (check git history for details).
48-
- dependency-name: "sigs.k8s.io/structured-merge-diff/*"
49-
# For now we deploy CAPI from an unreleased commit
50-
- dependency-name: "sigs.k8s.io/cluster-api*"
51-
# These dependencies are skipped because they require a newer version of go:
52-
- dependency-name: "github.com/a8m/envsubst"
5347
labels:
54-
- "area/dependency"
55-
- "ok-to-test"
48+
- "area/dependency"
49+
- "ok-to-test"
5650
## main branch config ends here
57-
## release-0.12 branch config starts here
51+
## release-0.13 branch config starts here
5852
# github-actions
5953
- directory: "/"
6054
package-ecosystem: "github-actions"
6155
schedule:
6256
interval: "weekly"
6357
day: "monday"
64-
target-branch: release-0.12
58+
target-branch: release-0.13
6559
groups:
6660
all-github-actions:
67-
patterns: [ "*" ]
61+
patterns: ["*"]
6862
commit-message:
6963
prefix: ":seedling:"
7064
include: scope
@@ -79,11 +73,11 @@ updates:
7973
schedule:
8074
interval: "weekly"
8175
day: "monday"
82-
target-branch: release-0.12
76+
target-branch: release-0.13
8377
groups:
8478
all-go-mod-patch-and-minor:
85-
patterns: [ "*" ]
86-
update-types: [ "patch", "minor" ]
79+
patterns: ["*"]
80+
update-types: ["patch", "minor"]
8781
commit-message:
8882
prefix: ":seedling:"
8983
include: scope
@@ -99,26 +93,21 @@ updates:
9993
update-types: ["version-update:semver-major", "version-update:semver-minor"]
10094
- dependency-name: "sigs.k8s.io/controller-tools"
10195
update-types: ["version-update:semver-major", "version-update:semver-minor"]
102-
# We will need k8s v0.31.3 to bump structured-merge-diff to v4.4.2 (check git history for details).
103-
- dependency-name: "sigs.k8s.io/structured-merge-diff/*"
104-
# These dependencies are skipped because they require a newer version of go:
105-
- dependency-name: "github.com/a8m/envsubst"
106-
- dependency-name: "github.com/onsi/gomega"
10796
labels:
108-
- "area/dependency"
109-
- "ok-to-test"
110-
## release-0.12 branch config ends here
111-
## release-0.11 branch config starts here
97+
- "area/dependency"
98+
- "ok-to-test"
99+
## release-0.13 branch config ends here
100+
## release-0.12 branch config starts here
112101
# github-actions
113102
- directory: "/"
114103
package-ecosystem: "github-actions"
115104
schedule:
116105
interval: "weekly"
117106
day: "monday"
118-
target-branch: release-0.11
107+
target-branch: release-0.12
119108
groups:
120109
all-github-actions:
121-
patterns: [ "*" ]
110+
patterns: ["*"]
122111
commit-message:
123112
prefix: ":seedling:"
124113
include: scope
@@ -129,16 +118,15 @@ updates:
129118
- directories:
130119
- "/"
131120
- "/hack/tools"
132-
- "/orc"
133121
package-ecosystem: "gomod"
134122
schedule:
135123
interval: "weekly"
136124
day: "monday"
137-
target-branch: release-0.11
125+
target-branch: release-0.12
138126
groups:
139127
all-go-mod-patch-and-minor:
140-
patterns: [ "*" ]
141-
update-types: [ "patch", "minor" ]
128+
patterns: ["*"]
129+
update-types: ["patch", "minor"]
142130
commit-message:
143131
prefix: ":seedling:"
144132
include: scope
@@ -158,13 +146,12 @@ updates:
158146
- dependency-name: "sigs.k8s.io/structured-merge-diff/*"
159147
# These dependencies are skipped because they require a newer version of go:
160148
- dependency-name: "github.com/a8m/envsubst"
161-
- dependency-name: "github.com/onsi/ginkgo/v2"
162149
- dependency-name: "github.com/onsi/gomega"
163-
- dependency-name: "github.com/prometheus/client_golang"
164-
- dependency-name: "go.uber.org/mock"
165150
- dependency-name: "golang.org/x/crypto"
166151
- dependency-name: "golang.org/x/text"
152+
# Newer kustomize requires a bump to kube-openapi, which has some incompatibility with gengo.
153+
- dependency-name: "sigs.k8s.io/kustomize/kustomize/*"
167154
labels:
168-
- "area/dependency"
169-
- "ok-to-test"
170-
## release-0.11 branch config ends here
155+
- "area/dependency"
156+
- "ok-to-test"
157+
## release-0.12 branch config ends here

Dockerfile

Lines changed: 3 additions & 3 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
@@ -36,13 +36,13 @@ COPY ./ ./
3636
# Build
3737
ARG package=.
3838
ARG ARCH
39-
ARG ldflags
39+
ARG ldflags=-s -w -extldflags=-static
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 \
4343
--mount=type=cache,target=/go/pkg/mod \
4444
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
45-
go build -ldflags "${ldflags} -extldflags '-static'" \
45+
go build -ldflags "${ldflags}" \
4646
-o manager ${package}
4747

4848
# Production image

Makefile

Lines changed: 83 additions & 8 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.24.4
30+
GO_VERSION ?= 1.24.9
3131

3232
# Directories.
3333
ARTIFACTS ?= $(REPO_ROOT)/_artifacts
@@ -68,6 +68,11 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
6868
GOTESTSUM := $(TOOLS_BIN_DIR)/gotestsum
6969
KUSTOMIZE := $(TOOLS_BIN_DIR)/kustomize
7070
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
71+
OPENAPI_GEN := $(TOOLS_BIN_DIR)/openapi-gen
72+
APPLYCONFIGURATION_GEN := $(TOOLS_BIN_DIR)/applyconfiguration-gen
73+
CLIENT_GEN := $(TOOLS_BIN_DIR)/client-gen
74+
LISTER_GEN := $(TOOLS_BIN_DIR)/lister-gen
75+
INFORMER_GEN := $(TOOLS_BIN_DIR)/informer-gen
7176
RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
7277
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup-envtest
7378
GEN_CRD_API_REFERENCE_DOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs
@@ -184,10 +189,12 @@ e2e-templates: $(addprefix $(E2E_NO_ARTIFACT_TEMPLATES_DIR)/, \
184189
cluster-template-without-lb.yaml \
185190
cluster-template.yaml \
186191
cluster-template-flatcar.yaml \
187-
cluster-template-k8s-upgrade.yaml \
192+
cluster-template-k8s-upgrade.yaml \
188193
cluster-template-flatcar-sysext.yaml \
189194
cluster-template-no-bastion.yaml \
190-
cluster-template-health-monitor.yaml)
195+
cluster-template-health-monitor.yaml \
196+
cluster-template-capi-v1beta1.yaml \
197+
cluster-template-cluster-identity.yaml)
191198
# Currently no templates that require CI artifacts
192199
# $(addprefix $(E2E_TEMPLATES_DIR)/, add-templates-here.yaml) \
193200
@@ -304,8 +311,64 @@ generate-controller-gen: $(CONTROLLER_GEN)
304311
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
305312

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

310373
.PHONY: generate-manifests
311374
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
@@ -339,7 +402,16 @@ generate-api-docs-%: $(GEN_CRD_API_REFERENCE_DOCS) FORCE
339402

340403
.PHONY: docker-build
341404
docker-build: ## Build the docker image for controller-manager
342-
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)
405+
docker build -f Dockerfile --build-arg GO_VERSION=$(GO_VERSION) \
406+
--build-arg goproxy=$(GOPROXY) \
407+
--build-arg ARCH=$(ARCH) . -t $(CONTROLLER_IMG_TAG)
408+
409+
.PHONY: docker-build-debug
410+
docker-build-debug: ## Build the docker image for controller-manager with debug info
411+
docker build -f Dockerfile --build-arg GO_VERSION=$(GO_VERSION) \
412+
--build-arg goproxy=$(GOPROXY) \
413+
--build-arg ARCH=$(ARCH) \
414+
--build-arg ldflags="-extldflags=-static" . -t $(CONTROLLER_IMG_TAG)
343415

344416
.PHONY: docker-push
345417
docker-push: ## Push the docker image
@@ -477,14 +549,17 @@ generate-release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES)
477549
if [ -n "${PRE_RELEASE}" ]; then \
478550
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; \
479551
fi
480-
"$(RELEASE_NOTES)" --from=$(PREVIOUS_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
552+
"$(RELEASE_NOTES)" --repository=kubernetes-sigs/cluster-api-provider-openstack \
553+
--prefix-area-label=false --add-kubernetes-version-support=false \
554+
--from=$(PREVIOUS_TAG) --release=$(RELEASE_TAG) >> $(RELEASE_NOTES_DIR)/$(RELEASE_TAG).md
481555

482556
.PHONY: templates
483557
templates: ## Generate cluster templates
484558
templates: templates/cluster-template.yaml \
485559
templates/cluster-template-without-lb.yaml \
486560
templates/cluster-template-flatcar.yaml \
487-
templates/cluster-template-flatcar-sysext.yaml
561+
templates/cluster-template-flatcar-sysext.yaml \
562+
templates/cluster-template-capi-v1beta1.yaml
488563

489564
templates/cluster-template.yaml: kustomize/v1beta1/default $(KUSTOMIZE) FORCE
490565
$(KUSTOMIZE) build "$<" > "$@"

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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@ 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+
- smoshiur1237

PROJECT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ resources:
2323
- group: infrastructure
2424
kind: OpenStackServer
2525
version: v1alpha1
26+
- group: infrastructure
27+
kind: OpenStackClusterIdentity
28+
version: v1alpha1
2629
- group: infrastructure
2730
version: "2"

0 commit comments

Comments
 (0)