Skip to content

Commit 47f199f

Browse files
committed
Merge branch 'main' into cloudkitty
2 parents 86c1aef + e3a0bb3 commit 47f199f

File tree

253 files changed

+30686
-30769
lines changed

Some content is hidden

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

253 files changed

+30686
-30769
lines changed

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: tools
33
namespace: openstack-k8s-operators
4-
tag: ci-build-root-golang-1.21-sdk-1.31
4+
tag: ci-build-root-golang-1.24-sdk-1.31

.github/workflows/build-openstack-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
1616
with:
1717
operator_name: openstack
18-
go_version: 1.21.x
18+
go_version: 1.24.x
1919
operator_sdk_version: 1.31.0
2020
bundle_dockerfile: ./bundle.Dockerfile
2121
secrets:

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Go
2222
uses: actions/setup-go@v3
2323
with:
24-
go-version: 1.21.x
24+
go-version: 1.24.x
2525
- uses: actions/checkout@v4
2626
with:
2727
# this fetches all branches. Needed because we need gh-pages branch for deploy to work

.github/workflows/force-bump-pr-manual.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ jobs:
99
with:
1010
operator_name: openstack
1111
branch_name: ${{ github.ref_name }}
12+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
1213
secrets:
1314
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

.github/workflows/force-bump-pr-scheduled.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ jobs:
1010
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/force-bump-branches.yaml@main
1111
with:
1212
operator_name: openstack
13+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
1314
secrets:
1415
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

.github/workflows/kustom.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Go
1717
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.21.x
19+
go-version: 1.24.x
2020
- uses: actions/checkout@v4
2121
with:
2222
# this fetches all branches. Needed because we need gh-pages branch for deploy to work

.golangci.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
version: 2
2+
13
linters:
24
# Enable specific linter
35
# https://golangci-lint.run/usage/linters/#enabled-by-default
46
enable:
57
- errorlint
68
- revive
79
- ginkgolinter
8-
- gofmt
910
- govet
11+
12+
formatters:
13+
enable:
14+
- gofmt
15+
1016
run:
1117
timeout: 5m

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repos:
7070
entry: bashate --error . --ignore=E006,E040,E011,E020,E012
7171

7272
- repo: https://github.com/golangci/golangci-lint
73-
rev: v1.59.1
73+
rev: v2.4.0
7474
hooks:
7575
- id: golangci-lint-full
7676
args: ["-v"]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.21
1+
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.24
22
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest
33
# Build the manager binary
44
FROM $GOLANG_BUILDER AS builder

Makefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ OPERATOR_SDK_VERSION ?= v1.31.0
5656
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/openstack-operator:latest
5757
IMG ?= $(DEFAULT_IMG)
5858
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
59-
ENVTEST_K8S_VERSION = 1.29
59+
ENVTEST_K8S_VERSION = 1.31
6060

6161
CRDDESC_OVERRIDE ?= :maxDescLen=0
6262

@@ -137,7 +137,7 @@ help: ## Display this help.
137137
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
138138
mkdir -p config/operator/rbac && \
139139
$(CONTROLLER_GEN) crd$(CRDDESC_OVERRIDE) output:crd:artifacts:config=config/crd/bases webhook paths="./..." && \
140-
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
140+
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="{./apis/lightspeed/...,./apis/client/...,./apis/core/...,./apis/dataplane/...,./controllers/lightspeed/...,./controllers/client/...,./controllers/core/...,./controllers/dataplane/...,./pkg/...}" output:dir=config/rbac && \
141141
$(CONTROLLER_GEN) rbac:roleName=operator-role paths="./controllers/operator/..." paths="./apis/operator/..." output:dir=config/operator/rbac && \
142142
rm -f apis/bases/* && cp -a config/crd/bases apis/
143143

@@ -151,8 +151,12 @@ bindata: kustomize yq ## Call sync bindata script
151151
mkdir -p bindata/crds bindata/rbac bindata/operator
152152
$(KUSTOMIZE) build config/crd > bindata/crds/crds.yaml
153153
$(KUSTOMIZE) build config/default > bindata/operator/operator.yaml
154-
sed -i bindata/operator/operator.yaml -e "/envCustomImage/c\\{{ range \$$envName, \$$envValue := .OpenStackServiceRelatedImages }}\n - name: {{ \$$envName }}\n value: {{ \$$envValue }}\n{{ end }}"
155-
sed -i bindata/operator/operator.yaml -e "s|kube-rbac-proxy:replace_me.*|'{{ .KubeRbacProxyImage }}'|"
154+
sed -i bindata/operator/operator.yaml -e "s|replicas:.*|replicas: {{ .OpenStackOperator.Deployment.Replicas }}|"
155+
sed -i bindata/operator/operator.yaml -e "/envCustom/c\\{{- range .OpenStackOperator.Deployment.Manager.Env }}\n - name: '{{ .Name }}'\n value: '{{ .Value }}'\n{{- end }}"
156+
sed -i bindata/operator/operator.yaml -e "/customLimits/c\\ cpu: {{ .OpenStackOperator.Deployment.Manager.Resources.Limits.CPU }}\n memory: {{ .OpenStackOperator.Deployment.Manager.Resources.Limits.Memory }}"
157+
sed -i bindata/operator/operator.yaml -e "/customRequests/c\\ cpu: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.CPU }}\n memory: {{ .OpenStackOperator.Deployment.Manager.Resources.Requests.Memory }}"
158+
sed -i bindata/operator/operator.yaml -e "s|kube-rbac-proxy:replace_me.*|'{{ .OpenStackOperator.Deployment.KubeRbacProxy.Image }}'|"
159+
sed -i bindata/operator/operator.yaml -e "/customTolerations/c\\ tolerations:\n{{- range .OpenStackOperator.Deployment.Tolerations }}\n - key: \"{{ .Key }}\"\n{{- if .Operator }}\n operator: \"{{ .Operator }}\"\n{{- end }}\n{{- if .Value }}\n value: \"{{ .Value }}\"\n{{- end }}\n{{- if .Effect }}\n effect: \"{{ .Effect }}\"\n{{- end }}\n{{- if .TolerationSeconds }}\n tolerationSeconds: {{ .TolerationSeconds }}\n{{- end }}\n{{- end }}"
156160
cp config/operator/managers.yaml bindata/operator/
157161
cp config/operator/rabbit.yaml bindata/operator/
158162
$(KUSTOMIZE) build config/rbac > bindata/rbac/rbac.yaml
@@ -182,9 +186,10 @@ tidy: ## Run go mod tidy on every mod file in the repo
182186
go mod tidy
183187
cd ./apis && go mod tidy
184188

189+
GOLANGCI_LINT_VERSION ?= v2.4.0
185190
.PHONY: golangci-lint
186191
golangci-lint:
187-
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
192+
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCI_LINT_VERSION)
188193
$(LOCALBIN)/golangci-lint run --fix
189194

190195
MAX_PROCS := 5
@@ -200,7 +205,7 @@ ginkgo-run: ## Run ginkgo.
200205
source hack/export_related_images.sh && \
201206
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" \
202207
OPERATOR_TEMPLATES="$(PWD)/templates" \
203-
$(GINKGO) --trace --cover --coverpkg=./pkg/openstack,./pkg/openstackclient,./pkg/util,./pkg/dataplane/...,./controllers/...,./apis/client/v1beta1,./apis/core/v1beta1,./apis/dataplane/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) $(GINKGO_TESTS)
208+
$(GINKGO) --trace --cover --coverpkg=./pkg/...,./controllers/...,./apis/... --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) $(GINKGO_TESTS)
204209

205210
.PHONY: test-all
206211
test-all: test golint golangci golangci-lint ## Run all tests.
@@ -299,16 +304,16 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
299304
ENVTEST ?= $(LOCALBIN)/setup-envtest
300305
CRD_MARKDOWN ?= $(LOCALBIN)/crd-to-markdown
301306
GINKGO ?= $(LOCALBIN)/ginkgo
302-
GINKGO_TESTS ?= ./tests/... ./apis/client/... ./apis/core/... ./apis/dataplane/... ./pkg/dataplane/...
307+
GINKGO_TESTS ?= ./tests/... ./apis/client/... ./apis/core/... ./apis/dataplane/... ./pkg/...
303308

304309
KUTTL ?= $(LOCALBIN)/kubectl-kuttl
305310

306311
## Tool Versions
307312
KUSTOMIZE_VERSION ?= v5.5.0 #(dprince: bumped to aquire new features like --load-restrictor)
308-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
313+
CONTROLLER_TOOLS_VERSION ?= v0.18.0
309314
CRD_MARKDOWN_VERSION ?= v0.0.3
310315
KUTTL_VERSION ?= 0.17.0
311-
GOTOOLCHAIN_VERSION ?= go1.21.0
316+
GOTOOLCHAIN_VERSION ?= go1.24.0
312317
OC_VERSION ?= 4.16.0
313318

314319
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
@@ -335,7 +340,7 @@ $(CRD_MARKDOWN): $(LOCALBIN)
335340
.PHONY: envtest
336341
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
337342
$(ENVTEST): $(LOCALBIN)
338-
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@c7e1dc9b
343+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
339344

340345
.PHONY: ginkgo
341346
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
@@ -505,6 +510,7 @@ SKIP_CERT ?=false
505510
run-with-webhook: export METRICS_PORT?=8080
506511
run-with-webhook: export HEALTH_PORT?=8081
507512
run-with-webhook: export PPROF_PORT?=8082
513+
run-with-webhook: export WEBHOOK_PORT?=9443
508514
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
509515
/bin/bash hack/run_with_local_webhook.sh
510516

0 commit comments

Comments
 (0)