Skip to content

Commit 429a693

Browse files
authored
Merge pull request #415 from datamattsson/ocp252
Build helm-operator from latest operator-sdk with latest UBI9
2 parents a829871 + fedeec7 commit 429a693

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

operators/hpe-csi-operator/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
csi-driver-operator
2+
operator-sdk
23
cache
34
prep
45
init

operators/hpe-csi-operator/Makefile

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ VERSION ?= 0.0.0
33
SOURCE_VERSION ?= $(VERSION)
44
REPO_NAME ?= quay.io/myrepo
55
# Do not use < 1.38.0
6-
OPERATOR_SDK = 'operator-sdk version: "v1.38.0"'
6+
OPERATOR_SDK_TAG = v1.39.1
7+
OPERATOR_SDK = 'operator-sdk version: "$(OPERATOR_SDK_TAG)"'
78

89
# Don't set these, preferably
910
RH_REPO_NAME=registry.connect.redhat.com/hpestorage
@@ -22,14 +23,16 @@ BUNDLE_IMG ?= $(REPO_NAME)/$(BUNDLE_NAME):v$(VERSION)
2223
OCP_BUNDLE_IMG ?= $(REPO_NAME)/$(OCP_BUNDLE_NAME):v$(VERSION)
2324
BUNDLE_CHANNELS ?= stable
2425
PLATFORMS ?= linux/arm64,linux/amd64
26+
OPERATOR_SDK_IMG_NAME ?= helm-operator
27+
OPERATOR_SDK_URL ?= $(REPO_NAME)/$(OPERATOR_SDK_IMG_NAME):$(OPERATOR_SDK_TAG)
2528

2629
undeploy:
2730
# Remove Operator from cluster
2831
- operator-sdk cleanup $(VANITY_NAME) -n $(NAMESPACE)
2932

3033
clean: undeploy
3134
# Delete build
32-
rm -rf "init" "prep" "$(IMAGE_NAME)" bundle-*
35+
rm -rf "operator-sdk" "init" "prep" "$(IMAGE_NAME)" bundle-*
3336

3437
init:
3538
# Ensure specific version of Operator SDK
@@ -47,6 +50,13 @@ init:
4750
--project-name $(VANITY_NAME) \
4851
--helm-chart ../../../docs/$(CHART)-$(VERSION).tgz \
4952
--helm-chart-version $(SOURCE_VERSION)
53+
54+
# Build & push our base Helm Operator with latest UBI images
55+
git clone https://github.com/operator-framework/operator-sdk
56+
cd operator-sdk; git checkout $(OPERATOR_SDK_TAG); docker-buildx build --progress=plain --no-cache \
57+
--provenance=false --push --platform=$(PLATFORMS) --tag $(OPERATOR_SDK_URL) -f images/helm-operator/Dockerfile .
58+
59+
# Mark complete
5060
touch init
5161

5262
prep: init
@@ -64,7 +74,7 @@ prep: init
6474
rm -f $(IMAGE_NAME)/config/manager/manager.yaml.remove
6575

6676
# Dockerfile for operator
67-
sed -e "s|%FROM%|$(shell grep ^FROM $(IMAGE_NAME)/Dockerfile)|" sources/operator.Dockerfile > $(IMAGE_NAME)/Dockerfile
77+
sed -e "s|%FROM%|FROM $(OPERATOR_SDK_URL)|" sources/operator.Dockerfile > $(IMAGE_NAME)/Dockerfile
6878
sed -i.remove -e "s/%SEMVER%/$(VERSION)/g" $(IMAGE_NAME)/Dockerfile && \
6979
rm -f $(IMAGE_NAME)/Dockerfile.remove
7080
cp -f sources/LICENSE $(IMAGE_NAME)/LICENSE

0 commit comments

Comments
 (0)