@@ -77,8 +77,8 @@ OPERATOR_RELEASE_AMD := $(OPERATOR_RELEASE_REGISTRY)/$(OPERATOR_IMAGE_NAME)
77
77
# ----------------------------------------------------------------------------------------------------------------------
78
78
# The Coherence version to build against - must be a Java 8 compatible version
79
79
COHERENCE_VERSION ?= 21.12.5
80
- COHERENCE_VERSION_LTS ?= 14.1.2-0-1
81
- COHERENCE_CE_LATEST ?= 24.09.2
80
+ COHERENCE_VERSION_LTS ?= 14.1.2-0-2
81
+ COHERENCE_CE_LATEST ?= 25.03.1
82
82
83
83
# The default Coherence image the Operator will run if no image is specified
84
84
COHERENCE_IMAGE_REGISTRY ?= $(ORACLE_REGISTRY )
@@ -1067,23 +1067,31 @@ $(TOOLS_BIN)/opm: ## Download opm locally if necessary.
1067
1067
1068
1068
# The image tag given to the resulting catalog image
1069
1069
CATALOG_IMAGE_NAME := $(OLM_IMAGE_REGISTRY ) /$(OPERATOR_IMAGE_NAME ) -catalog
1070
- CATALOG_IMAGE := $(CATALOG_IMAGE_NAME ) :latest
1070
+ CATALOG_TAG ?= latest
1071
+ CATALOG_IMAGE := $(CATALOG_IMAGE_NAME ) :$(CATALOG_TAG )
1071
1072
1072
1073
# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
1073
- # This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
1074
+ # This is effectively the same thing that will happen in the OpenShift community operator repo
1075
+ # This recipe invokes 'opm' in 'basic' bundle add mode. For more information on add modes, see:
1074
1076
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
1075
- .PHONY : catalog-build
1076
- catalog-build : opm # # Build a catalog image (the bundle image must have been pushed first).
1077
+ .PHONY : catalog-prepare
1078
+ catalog-prepare : opm $( TOOLS_BIN ) /yq # # Build a catalog image (the bundle image must have been pushed first).
1077
1079
rm -rf catalog || true
1078
1080
mkdir -p catalog
1079
1081
rm catalog.Dockerfile || true
1080
1082
$(OPM ) generate dockerfile catalog
1081
- cp $(SCRIPTS_DIR ) /olm/olm-catalog-template.yaml $(BUILD_OUTPUT ) /olm-catalog-template.yaml
1082
- printf " - Image: $( BUNDLE_IMAGE) " >> $(BUILD_OUTPUT ) /olm-catalog-template.yaml
1083
- $(OPM ) alpha render-template semver -o yaml < $(BUILD_OUTPUT ) /olm-catalog-template.yaml > catalog/operator.yaml
1083
+ mkdir -p $(BUILD_OUTPUT ) /catalog || true
1084
+ cp $(SCRIPTS_DIR ) /olm/catalog-template.yaml $(BUILD_OUTPUT ) /catalog/catalog-template.yaml
1085
+ yq -i e ' select(.schema == "olm.template.basic").entries[] |= select(.schema == "olm.channel" and .name == "stable").entries += [{"name" : "coherence-operator.v$(VERSION)", "replaces": "coherence-operator.v$(PREV_VERSION)"}]' $(BUILD_OUTPUT ) /catalog/catalog-template.yaml
1086
+ yq -i e ' select(.schema == "olm.template.basic").entries += [{"schema" : "olm.bundle", "image": "$(BUNDLE_IMAGE)"}]' $(BUILD_OUTPUT ) /catalog/catalog-template.yaml
1087
+ $(OPM ) alpha render-template basic -o yaml $(BUILD_OUTPUT ) /catalog/catalog-template.yaml > catalog/operator.yaml
1084
1088
$(OPM ) validate catalog
1085
1089
$(DOCKER_CMD ) build --load -f catalog.Dockerfile -t $(CATALOG_IMAGE ) .
1086
1090
1091
+ .PHONY : catalog-build
1092
+ catalog-build : catalog-prepare # # Build a catalog image (the bundle image must have been pushed first).
1093
+ $(DOCKER_CMD ) build --load -f catalog.Dockerfile -t $(CATALOG_IMAGE ) .
1094
+
1087
1095
# Push the catalog image.
1088
1096
.PHONY : catalog-push
1089
1097
catalog-push : catalog-build # # Push a catalog image.
@@ -1129,30 +1137,47 @@ endif
1129
1137
1130
1138
.PHONY : olm-undeploy-catalog
1131
1139
olm-undeploy-catalog : # # Undeploy the Operator Catalog from OLM
1132
- $(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) delete catalogsource coherence-operator-catalog
1133
-
1140
+ $(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) delete catalogsource coherence-operator-catalog || true
1134
1141
1135
- .PHONY : wait-for-olm-deploy
1136
- wait-for-olm-deploy : export POD=$(shell $(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) get pod -l olm.catalogSource=coherence-operator-catalog -o name)
1137
- wait-for-olm-deploy : # # Wait for the Operator Catalog to be deployed into OLM
1142
+ .PHONY : wait-for-olm-catalog- deploy
1143
+ wait-for-olm-catalog- deploy : export POD=$(shell $(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) get pod -l olm.catalogSource=coherence-operator-catalog -o name)
1144
+ wait-for-olm-catalog- deploy : # # Wait for the Operator Catalog to be deployed into OLM
1138
1145
echo " Operator Catalog Source Pods:"
1139
1146
$(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) get pod -l olm.catalogSource=coherence-operator-catalog
1140
1147
echo " Waiting for Operator Catalog Source to be ready. Pod: $( POD) "
1141
1148
$(KUBECTL_CMD ) -n $(CATALOG_SOURCE_NAMESPACE ) wait --for condition=ready --timeout 480s $(POD )
1142
1149
1143
1150
.PHONY : olm-deploy
1144
- olm-deploy : # # Deploy the Operator into the coherence namespace using OLM
1145
- $(KUBECTL_CMD ) create ns coherence || true
1146
- $(KUBECTL_CMD ) -n coherence apply -f $(SCRIPTS_DIR ) /olm/operator-group.yaml
1147
- $(KUBECTL_CMD ) -n coherence apply -f $(SCRIPTS_DIR ) /olm/operator-subscription.yaml
1151
+ olm-deploy : # # Deploy the Operator into the test namespace using OLM
1152
+ cp $(SCRIPTS_DIR ) /olm/operator-group.yaml $(BUILD_OUTPUT ) /catalog/operator-group.yaml
1153
+ $(SED ) -e ' s^NAMESPACE_PLACEHOLDER^$(CATALOG_SOURCE_NAMESPACE)^g' $(BUILD_OUTPUT ) /catalog/operator-group.yaml
1154
+ cp $(SCRIPTS_DIR ) /olm/operator-subscription.yaml $(BUILD_OUTPUT ) /catalog/operator-subscription.yaml
1155
+ $(SED ) -e ' s^NAMESPACE_PLACEHOLDER^$(CATALOG_SOURCE_NAMESPACE)^g' $(BUILD_OUTPUT ) /catalog/operator-subscription.yaml
1156
+ $(KUBECTL_CMD ) create ns $(OPERATOR_NAMESPACE ) || true
1157
+ $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) apply -f $(BUILD_OUTPUT ) /catalog/operator-group.yaml
1158
+ $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) apply -f $(BUILD_OUTPUT ) /catalog/operator-subscription.yaml
1148
1159
sleep 10
1149
- $(KUBECTL_CMD ) -n coherence get ip
1150
- $(KUBECTL_CMD ) -n coherence get csv
1151
- $(KUBECTL_CMD ) -n coherence wait --for condition=available deployment/coherence-operator-controller-manager -timeout 480s
1160
+ $(KUBECTL_CMD ) -n $( OPERATOR_NAMESPACE ) get ip
1161
+ $(KUBECTL_CMD ) -n $( OPERATOR_NAMESPACE ) get csv
1162
+ $(KUBECTL_CMD ) -n $( OPERATOR_NAMESPACE ) wait --for condition=available deployment/coherence-operator-controller-manager - -timeout 480s
1152
1163
1153
1164
.PHONY : olm-undeploy
1154
1165
olm-undeploy : # # Undeploy the Operator that was installed with OLM
1155
- $(KUBECTL_CMD ) -n coherence delete csv coherence-operator.v$(VERSION )
1166
+ $(KUBECTL_CMD ) -n coherence delete csv coherence-operator.v$(VERSION ) || true
1167
+ $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) apply -f $(BUILD_OUTPUT ) /catalog/operator-group.yaml || true
1168
+ $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) apply -f $(BUILD_OUTPUT ) /catalog/operator-subscription.yaml || true
1169
+
1170
+ .PHONY : olm-e2e-test
1171
+ olm-e2e-test : export MF = $(MAKEFLAGS )
1172
+ olm-e2e-test : prepare-olm-e2e-test # # Run the Operator end-to-end 'remote' functional tests using an Operator deployed with OLM in k8s
1173
+ $(MAKE ) run-e2e-test $$ {MF} \
1174
+ ; rc=$$? \
1175
+ ; $(MAKE ) olm-undeploy $$ {MF} \
1176
+ ; $(MAKE ) delete-namespace $$ {MF} \
1177
+ ; exit $$ rc
1178
+
1179
+ .PHONY : prepare-olm-e2e-test
1180
+ prepare-olm-e2e-test : reset-namespace create-ssl-secrets ensure-pull-secret olm-deploy
1156
1181
1157
1182
# ======================================================================================================================
1158
1183
# Targets to run a local container registry
@@ -2334,29 +2359,26 @@ $(TOOLS_BIN)/yq:
2334
2359
# ======================================================================================================================
2335
2360
# #@ Cert Manager
2336
2361
2337
- CERT_MANAGER_VERSION ?= v1.8.0
2338
- # Get latest version...
2339
- # curl -s -H "Accept: application/vnd.github.v3+json" --header $(GH_AUTH) https://api.github.com/repos/cert-manager/cert-manager/releases | jq '.[0].tag_name' | tr -d '"'
2362
+ CERT_MANAGER_VERSION ?= v1.17.2
2340
2363
2341
2364
.PHONY : install-cmctl
2342
2365
install-cmctl : $(TOOLS_BIN ) /cmctl # # Install the Cert Manager CLI into $(TOOLS_BIN)
2343
2366
2344
2367
CMCTL = $(TOOLS_BIN ) /cmctl
2345
2368
$(TOOLS_BIN ) /cmctl :
2346
2369
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
2347
- curl -sSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager /releases/download/$( CERT_MANAGER_VERSION ) /cmctl- $$ {OS}- $$ {ARCH}.tar.gz --header $( GH_AUTH )
2348
- tar xzf cmctl.tar.gz
2370
+ curl -fsSL -o cmctl https://github.com/cert-manager/cmctl /releases/latest/ download/cmctl_ $ {OS}_ $ {ARCH}
2371
+ chmod +x cmctl
2349
2372
mv cmctl $(TOOLS_BIN )
2350
- rm cmctl.tar.gz
2351
2373
2352
2374
.PHONY : install-cert-manager
2353
2375
install-cert-manager : $(TOOLS_BIN ) /cmctl # # Install Cert manager into the Kubernetes cluster
2354
- $(KUBECTL_CMD ) apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0 /cert-manager.yam
2376
+ $(KUBECTL_CMD ) apply -f https://github.com/cert-manager/cert-manager/releases/download/$( CERT_MANAGER_VERSION ) /cert-manager.yaml
2355
2377
$(CMCTL ) check api --wait=10m
2356
2378
2357
2379
.PHONY : uninstall-cert-manager
2358
2380
uninstall-cert-manager : # # Uninstall Cert manager from the Kubernetes cluster
2359
- $(KUBECTL_CMD ) delete -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION ) /cert-manager.yam
2381
+ $(KUBECTL_CMD ) delete -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION ) /cert-manager.yaml
2360
2382
2361
2383
2362
2384
# ======================================================================================================================
@@ -2978,7 +3000,8 @@ new-version: ## Update the Operator Version (must be run with NEXT_VERSION=x.y.z
2978
3000
find config \( -name ' *.yaml' -o -name ' *.json' \) -exec $(SED ) ' s/$(subst .,\.,$(VERSION))/$(NEXT_VERSION)/g' {} +
2979
3001
find helm-charts \( -name ' *.yaml' -o -name ' *.json' \) -exec $(SED ) ' s/$(subst .,\.,$(VERSION))/$(NEXT_VERSION)/g' {} +
2980
3002
$(SED ) -e ' s/<revision>$(subst .,\.,$(VERSION))<\/revision>/<revision>$(NEXT_VERSION)<\/revision>/g' java/pom.xml
2981
- printf " - Image: $( BUNDLE_IMAGE) " >> $(SCRIPTS_DIR ) /olm/olm-catalog-template.yaml
3003
+ yq -i e ' select(.schema == "olm.template.basic").entries[] |= select(.schema == "olm.channel" and .name == "stable").entries += [{"name" : "coherence-operator.v$(VERSION)", "replaces": "coherence-operator.v$(PREV_VERSION)"}]' $(SCRIPTS_DIR ) /olm/olm-catalog-template.yaml
3004
+ yq -i e ' select(.schema == "olm.template.basic").entries += [{"schema" : "olm.bundle", "image": "$(BUNDLE_IMAGE)"}]' $(SCRIPTS_DIR ) /olm/olm-catalog-template.yaml
2982
3005
2983
3006
2984
3007
GIT_BRANCH ="version-update-$(VERSION ) "
0 commit comments