From 9f301ec358305e3a1af482fbd94240b75b54bf65 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Thu, 18 Jun 2026 11:05:43 +0200 Subject: [PATCH 1/3] Add kuttl test artifacts to .gitignore Simply ignore the `kubeconfig` and `kuttl-report-openstack-lightspeed.xml` files that are generated during a kuttl test run (eg: `make kuttl-test-ocp`). --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 52b6e27f..f939691f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,7 @@ go.work *.swp *.swo *~ + +# Kuttl test files +kubeconfig +kuttl-report-openstack-lightspeed.xml From ecc85fca5db7d182c7f43915c51dc00817701113 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Mon, 1 Jun 2026 12:29:54 +0200 Subject: [PATCH 2/3] Add ocp-deploy and ocp-deploy-cleanup targets Similar to `kuttl-test-ocp` that deploys and runs kuttl we now add a couple of convenient make targets to help development: - `ocp-deploy` - `ocp-deploy-cleanup` --- Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 09e511f0..4b55a75b 100644 --- a/Makefile +++ b/Makefile @@ -219,10 +219,12 @@ openstack-lightspeed-deploy: ## Deploy using a catalog image. oc apply -f $(OUTPUT_DIR)/rhosls bash scripts/confirm-rhosls-running.sh -# Deploy using the catalog image. +# Undeploy using the catalog image. +# Remove OpenStackLightspeds so the namespace deletion doesn't get stuck .PHONY: openstack-lightspeed-undeploy openstack-lightspeed-undeploy: export OUTPUT_DIR = out openstack-lightspeed-undeploy: ## Undeploy using a catalog image. + oc delete openstacklightspeed --all -n openstack-lightspeed --ignore-not-found=true --timeout=120s find out/{catalog,rhosls} -name "*.yaml" -printf " -f %p" | xargs oc delete --ignore-not-found=true CATALOG_NAME ?= openstack-lightspeed-catalog @@ -299,6 +301,20 @@ kuttl-test-ocp: BUNDLE_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/oper kuttl-test-ocp: CATALOG_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/operator-catalog:$(TAG) kuttl-test-ocp: docker-build bundle bundle-build ocp-catalog-build ocp-registry-push kuttl-test-run +.PHONY: ocp-deploy +ocp-deploy: IMG = $(OCP_INTERNAL_REGISTRY)/$(OCP_REGISTRY_NAMESPACE)/operator:latest +ocp-deploy: BUNDLE_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/operator-bundle:$(TAG) +ocp-deploy: CATALOG_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/operator-catalog:$(TAG) +ocp-deploy: docker-build bundle bundle-build ocp-catalog-build ocp-registry-push openstack-lightspeed-deploy + +.PHONY: ocp-deploy-cleanup +ocp-deploy-cleanup: IMG = $(OCP_INTERNAL_REGISTRY)/$(OCP_REGISTRY_NAMESPACE)/operator:latest +ocp-deploy-cleanup: BUNDLE_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/operator-bundle:$(TAG) +ocp-deploy-cleanup: CATALOG_IMG = $(OCP_INTERNAL_REGISTRY)/openshift-marketplace/operator-catalog:$(TAG) +ocp-deploy-cleanup: openstack-lightspeed-undeploy ## Clean up everything created by ocp-deploy. + oc delete imagestreamtag operator-catalog:$(TAG) -n openshift-marketplace --ignore-not-found=true + oc delete namespace $(OCP_REGISTRY_NAMESPACE) --ignore-not-found=true --wait + # go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist # $1 - target path with name of binary # $2 - package url which can be installed From 7396ab613d7c0103576c094c39ed98bfd185c970 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Wed, 17 Jun 2026 15:53:07 +0200 Subject: [PATCH 3/3] Add GOMAXPROCS support when building Right now when we build the container (make docker-build) or the controller (make build) the go compiler will try to use all the CPUs on the machine. This can become problematic in some systems that may suffer starvation (eg: audio problems), so we add support for the `GOMAXPROCS` env var to be passed to those 2 make targets. --- Dockerfile | 3 ++- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7366762e..0fd573f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM golang:1.24 AS builder ARG TARGETOS ARG TARGETARCH +ARG GOMAXPROCS WORKDIR /workspace # Copy the Go Modules manifests @@ -21,7 +22,7 @@ COPY internal/controller/ internal/controller/ # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go +RUN GOMAXPROCS=${GOMAXPROCS} CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Makefile b/Makefile index 4b55a75b..88ec7349 100644 --- a/Makefile +++ b/Makefile @@ -146,7 +146,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes .PHONY: build build: manifests generate fmt vet ## Build manager binary. - go build -o bin/manager cmd/main.go + GOMAXPROCS=$(GOMAXPROCS) go build -o bin/manager cmd/main.go .PHONY: run run: manifests generate fmt vet ## Run a controller from your host. @@ -157,7 +157,7 @@ run: manifests generate fmt vet ## Run a controller from your host. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . + $(CONTAINER_TOOL) build --build-arg GOMAXPROCS=$(GOMAXPROCS) -t ${IMG} . .PHONY: docker-push docker-push: ## Push docker image with the manager.