Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/release_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:

env:
image_tag: quay.io/orc/openstack-resource-controller:${GITHUB_REF_NAME}
bundle_image_tag: quay.io/orc/openstack-resource-controller-bundle:${GITHUB_REF_NAME}

jobs:
push:
Expand All @@ -24,7 +25,11 @@ jobs:
fetch-tags: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install build dependencies
run: sudo apt-get install -y libgpgme-dev

- run: |
docker login -u="${{ secrets.QUAY_USERNAME }}" -p="${{ secrets.QUAY_TOKEN }}" quay.io
make docker-buildx IMG=${{ env.image_tag }}
make build-bundle-image BUNDLE_IMG=${{ env.bundle_image_tag }}
Comment thread
mandre marked this conversation as resolved.
make docker-push IMG=${{ env.bundle_image_tag }}
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
BUNDLE_IMG ?= bundle:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0
TRIVY_VERSION = 0.49.1
Expand Down Expand Up @@ -207,6 +208,11 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
$(MAKE) custom-deploy IMG=${IMG}
$(KUSTOMIZE) build $(CUSTOMDEPLOY) > dist/install.yaml

.PHONY: build-bundle-image
build-bundle-image: kustomize operator-sdk
bash hack/bundle.sh
$(CONTAINER_TOOL) build -f bundle.Dockerfile -t ${BUNDLE_IMG} .

##@ Deployment

ifndef ignore-not-found
Expand Down Expand Up @@ -299,6 +305,7 @@ GOLANGCI_KAL = $(LOCALBIN)/golangci-kube-api-linter
MOCKGEN = $(LOCALBIN)/mockgen
KUTTL = $(LOCALBIN)/kubectl-kuttl
GOVULNCHECK = $(LOCALBIN)/govulncheck
OPERATOR_SDK = $(LOCALBIN)/operator-sdk

## Tool Versions
KUSTOMIZE_VERSION ?= v5.6.0
Expand All @@ -309,6 +316,7 @@ KAL_VERSION ?= v0.0.0-20250531094218-f86bf7bd4b19
MOCKGEN_VERSION ?= v0.5.0
KUTTL_VERSION ?= v0.22.0
GOVULNCHECK_VERSION ?= v1.1.4
OPERATOR_SDK_VERSION ?= v1.41.1

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down Expand Up @@ -363,6 +371,11 @@ govulncheck: $(GOVULNCHECK) ## Download govulncheck locally if necessary.
$(GOVULNCHECK): $(LOCALBIN)
$(call go-install-tool,$(GOVULNCHECK),golang.org/x/vuln/cmd/govulncheck,$(GOVULNCHECK_VERSION))

.PHONY: operator-sdk
operator-sdk: $(OPERATOR_SDK) ## Download operator-sdk locally if necessary.
$(OPERATOR_SDK): $(LOCALBIN)
$(call go-install-tool,$(OPERATOR_SDK),github.com/operator-framework/operator-sdk/cmd/operator-sdk,$(OPERATOR_SDK_VERSION))

# 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
Expand Down
5 changes: 4 additions & 1 deletion hack/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

REGISTRY=${REGISTRY:-quay.io/orc}
IMAGE=${BASE_IMAGE:-openstack-resource-controller}
TAG=${BASE_IMAGE:-$(git describe --abbrev=0)}
TAG=${BASE_IMAGE:-$(git describe --abbrev=0 --tags)}
IMG=${REGISTRY}/${IMAGE}:${TAG}

# Update config/manifests/bases/orc.clusterserviceversion.yaml if needed
Expand All @@ -14,6 +14,9 @@ mkdir "${TMP_OVERLAY}"
pushd "${TMP_OVERLAY}" || exit
kustomize create --resources ../manifests
kustomize edit set image controller="${IMG}"

kustomize edit add patch --kind ClusterServiceVersion --name "orc.*" --patch '[{"op": "replace", "path": "/spec/version", "value": "'$TAG'"}]'
kustomize edit add patch --kind ClusterServiceVersion --name "orc.*" --patch '[{"op": "replace", "path": "/metadata/name", "value": "orc.'$TAG'"}]'
popd || exit

# Generate bundle and bundle.Dockerfile
Expand Down