@@ -56,7 +56,7 @@ OPERATOR_SDK_VERSION ?= v1.31.0
5656DEFAULT_IMG ?= quay.io/openstack-k8s-operators/openstack-operator:latest
5757IMG ?= $(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
6161CRDDESC_OVERRIDE ?= :maxDescLen=0
6262
@@ -137,7 +137,7 @@ help: ## Display this help.
137137manifests : 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
186191golangci-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
190195MAX_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
206211test-all : test golint golangci golangci-lint # # Run all tests.
@@ -299,16 +304,16 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
299304ENVTEST ?= $(LOCALBIN ) /setup-envtest
300305CRD_MARKDOWN ?= $(LOCALBIN ) /crd-to-markdown
301306GINKGO ?= $(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
304309KUTTL ?= $(LOCALBIN ) /kubectl-kuttl
305310
306311# # Tool Versions
307312KUSTOMIZE_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
309314CRD_MARKDOWN_VERSION ?= v0.0.3
310315KUTTL_VERSION ?= 0.17.0
311- GOTOOLCHAIN_VERSION ?= go1.21 .0
316+ GOTOOLCHAIN_VERSION ?= go1.24 .0
312317OC_VERSION ?= 4.16.0
313318
314319KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
@@ -335,7 +340,7 @@ $(CRD_MARKDOWN): $(LOCALBIN)
335340.PHONY : envtest
336341envtest : $(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
341346ginkgo : $(GINKGO ) # # Download ginkgo locally if necessary.
@@ -505,6 +510,7 @@ SKIP_CERT ?=false
505510run-with-webhook : export METRICS_PORT?=8080
506511run-with-webhook : export HEALTH_PORT?=8081
507512run-with-webhook : export PPROF_PORT?=8082
513+ run-with-webhook : export WEBHOOK_PORT?=9443
508514run-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