@@ -771,17 +771,19 @@ manifests: $(BUILD_TARGETS)/manifests ## Generate the CustomResourceDefinition a
771
771
$(BUILD_TARGETS ) /manifests : $(BUILD_PROPS ) config/crd/bases/coherence.oracle.com_coherence.yaml docs/about/04_coherence_spec.adoc $(MANIFEST_FILES ) $(BUILD_MANIFESTS_PKG )
772
772
touch $(BUILD_TARGETS ) /manifests
773
773
774
- config/crd/bases/coherence.oracle.com_coherence.yaml : $(TOOLS_BIN ) /kustomize $(API_GO_FILES ) $(TOOLS_BIN ) /controller-gen
774
+ config/crd/bases/coherence.oracle.com_coherence.yaml : $(TOOLS_BIN ) /kustomize $(API_GO_FILES ) $(TOOLS_BIN ) /controller-gen get-yq
775
775
$(CONTROLLER_GEN ) " crd:crdVersions={v1}" \
776
776
rbac:roleName=manager-role paths=" {./api/...,./controllers/...}" \
777
777
output:crd:dir=config/crd/bases
778
778
cp -R config/crd/ config/crd-small
779
779
$(CONTROLLER_GEN ) " crd:crdVersions={v1},maxDescLen=0" \
780
780
rbac:roleName=manager-role paths=" {./api/...,./controllers/...}" \
781
781
output:crd:dir=config/crd-small/bases
782
- cd config/crd && $(KUSTOMIZE ) edit add label " app.kubernetes.io/version:$( VERSION) " -f
783
- $(KUSTOMIZE ) build config/crd -o $(BUILD_ASSETS ) /
784
- cd config/crd-small && $(KUSTOMIZE ) edit add label " app.kubernetes.io/version:$( VERSION) " -f
782
+ $(YQ ) eval -i ' .metadata.labels["app.kubernetes.io/version"] = "$(VERSION)"' config/crd/bases/coherence.oracle.com_coherence.yaml
783
+ $(YQ ) eval -i ' .metadata.labels["app.kubernetes.io/version"] = "$(VERSION)"' config/crd/bases/coherence.oracle.com_coherencejob.yaml
784
+ $(YQ ) eval -i ' .metadata.labels["app.kubernetes.io/version"] = "$(VERSION)"' config/crd-small/bases/coherence.oracle.com_coherence.yaml
785
+ $(YQ ) eval -i ' .metadata.labels["app.kubernetes.io/version"] = "$(VERSION)"' config/crd-small/bases/coherence.oracle.com_coherencejob.yaml
786
+ $(KUSTOMIZE ) build config/crd-small -o $(BUILD_ASSETS ) /
785
787
786
788
# ----------------------------------------------------------------------------------------------------------------------
787
789
# Generate the config.json file used by the Operator for default configuration values
@@ -1228,7 +1230,7 @@ oc-login:
1228
1230
test-operator : export CGO_ENABLED = 0
1229
1231
test-operator : export COHERENCE_IMAGE := $(COHERENCE_IMAGE )
1230
1232
test-operator : export OPERATOR_IMAGE := $(OPERATOR_IMAGE )
1231
- test-operator : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests $(BUILD_TARGETS ) /generate gotestsum # # Run the Operator unit tests
1233
+ test-operator : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests $(BUILD_TARGETS ) /generate install-crds gotestsum # # Run the Operator unit tests
1232
1234
@echo " Running operator tests"
1233
1235
$(GOTESTSUM ) --format standard-verbose --junitfile $(TEST_LOGS_DIR ) /operator-test.xml \
1234
1236
-- $(GO_TEST_FLAGS ) -v ./api/... ./controllers/... ./pkg/...
@@ -1393,7 +1395,7 @@ e2e-k3d-test: export MVN_VERSION := $(MVN_VERSION)
1393
1395
e2e-k3d-test : export OPERATOR_IMAGE := $(OPERATOR_IMAGE )
1394
1396
e2e-k3d-test : export COHERENCE_IMAGE := $(COHERENCE_IMAGE )
1395
1397
e2e-k3d-test : export SKIP_SPRING_CNBP := $(SKIP_SPRING_CNBP )
1396
- e2e-k3d-test : reset-namespace create-ssl-secrets gotestsum undeploy # # Run the Operator end-to-end 'local' functional tests using a local Operator instance
1398
+ e2e-k3d-test : reset-namespace create-ssl-secrets gotestsum undeploy install-crds ensure-pull-secret # # Run the Operator end-to-end 'local' functional tests using a local Operator instance
1397
1399
$(GOTESTSUM ) --format standard-verbose --junitfile $(TEST_LOGS_DIR ) /operator-e2e-k3d-test.xml \
1398
1400
-- $(GO_TEST_FLAGS_E2E ) ./test/e2e/large-cluster/...
1399
1401
@@ -1416,7 +1418,7 @@ e2e-client-test: export VERSION := $(VERSION)
1416
1418
e2e-client-test : export MVN_VERSION := $(MVN_VERSION )
1417
1419
e2e-client-test : export OPERATOR_IMAGE := $(OPERATOR_IMAGE )
1418
1420
e2e-client-test : export COHERENCE_IMAGE := $(COHERENCE_IMAGE )
1419
- e2e-client-test : build-client-image reset-namespace create-ssl-secrets gotestsum undeploy # # Run the end-to-end Coherence client tests using a local Operator deployment
1421
+ e2e-client-test : build-client-image reset-namespace create-ssl-secrets gotestsum undeploy install-crds ensure-pull-secret # # Run the end-to-end Coherence client tests using a local Operator deployment
1420
1422
$(GOTESTSUM ) --format standard-verbose --junitfile $(TEST_LOGS_DIR ) /operator-e2e-client-test.xml \
1421
1423
-- $(GO_TEST_FLAGS_E2E ) ./test/e2e/clients/...
1422
1424
@@ -1432,7 +1434,7 @@ e2e-helm-test: export COHERENCE_IMAGE_REGISTRY := $(COHERENCE_IMAGE_REGISTRY)
1432
1434
e2e-helm-test : export COHERENCE_IMAGE_NAME := $(COHERENCE_IMAGE_NAME )
1433
1435
e2e-helm-test : export COHERENCE_IMAGE_TAG := $(COHERENCE_IMAGE_TAG )
1434
1436
e2e-helm-test : export COHERENCE_IMAGE := $(COHERENCE_IMAGE )
1435
- e2e-helm-test : $(BUILD_PROPS ) $(BUILD_HELM ) /coherence-operator-$(VERSION ) .tgz reset-namespace gotestsum # # Run the Operator Helm chart end-to-end functional tests
1437
+ e2e-helm-test : $(BUILD_PROPS ) $(BUILD_HELM ) /coherence-operator-$(VERSION ) .tgz uninstall-crds reset-namespace gotestsum # # Run the Operator Helm chart end-to-end functional tests
1436
1438
$(GOTESTSUM ) --format standard-verbose --junitfile $(TEST_LOGS_DIR ) /operator-e2e-helm-test.xml \
1437
1439
-- $(GO_TEST_FLAGS_E2E ) ./test/e2e/helm/...
1438
1440
@@ -1449,7 +1451,7 @@ e2e-helm-test: $(BUILD_PROPS) $(BUILD_HELM)/coherence-operator-$(VERSION).tgz re
1449
1451
# ----------------------------------------------------------------------------------------------------------------------
1450
1452
.PHONY : e2e-prometheus-test
1451
1453
e2e-prometheus-test : export MF = $(MAKEFLAGS )
1452
- e2e-prometheus-test : reset-namespace install-prometheus create-ssl-secrets deploy-and-wait # # Run the Operator metrics/Prometheus end-to-end functional tests
1454
+ e2e-prometheus-test : reset-namespace install-prometheus create-ssl-secrets ensure-pull-secret deploy-and-wait # # Run the Operator metrics/Prometheus end-to-end functional tests
1453
1455
$(MAKE ) run-prometheus-test $$ {MF} \
1454
1456
; rc=$$? \
1455
1457
; $(MAKE ) uninstall-prometheus $$ {MF} \
@@ -1491,7 +1493,7 @@ run-prometheus-test: gotestsum
1491
1493
# These tests will use whichever k8s cluster the local environment is pointing to.
1492
1494
# ----------------------------------------------------------------------------------------------------------------------
1493
1495
.PHONY : compatibility-test
1494
- compatibility-test : undeploy build-all-images $( BUILD_HELM ) /coherence-operator- $( VERSION ) .tgz undeploy clean-namespace reset-namespace gotestsum just-compatibility-test # # Run the Operator backwards compatibility tests
1496
+ compatibility-test : undeploy build-all-images helm-chart undeploy clean-namespace reset-namespace ensure-pull-secret gotestsum just-compatibility-test # # Run the Operator backwards compatibility tests
1495
1497
1496
1498
.PHONY : just-compatibility-test
1497
1499
just-compatibility-test : export CGO_ENABLED = 0
@@ -1547,7 +1549,7 @@ certification-test: install-certification ## Run the Operator Kubernetes ver
1547
1549
# Install the Operator prior to running compatibility tests.
1548
1550
# ----------------------------------------------------------------------------------------------------------------------
1549
1551
.PHONY : install-certification
1550
- install-certification : $(BUILD_TARGETS ) /build-operator prepare-network-policies reset-namespace create-ssl-secrets deploy-and-wait
1552
+ install-certification : $(BUILD_TARGETS ) /build-operator prepare-network-policies reset-namespace create-ssl-secrets ensure-pull-secret deploy-and-wait
1551
1553
1552
1554
# ----------------------------------------------------------------------------------------------------------------------
1553
1555
# Executes the Go end-to-end Operator certification tests.
@@ -1745,8 +1747,8 @@ cleanup-coherence-compatibility: undeploy uninstall-crds clean-namespace
1745
1747
# configured to use.
1746
1748
# ----------------------------------------------------------------------------------------------------------------------
1747
1749
.PHONY : install-crds
1748
- install-crds : prepare-deploy uninstall-crds # # Install the CRDs
1749
- $(KUSTOMIZE ) build $(BUILD_DEPLOY ) /crd | $(KUBECTL_CMD ) create -f -
1750
+ install-crds : prepare-deploy # # Install the CRDs
1751
+ $(KUSTOMIZE ) build $(BUILD_DEPLOY ) /crd-small | $(KUBECTL_CMD ) apply -f -
1750
1752
1751
1753
# ----------------------------------------------------------------------------------------------------------------------
1752
1754
# Uninstall CRDs from Kubernetes.
@@ -1761,6 +1763,22 @@ uninstall-crds: $(BUILD_TARGETS)/manifests ## Uninstall the CRDs
1761
1763
$(KUSTOMIZE ) build $(BUILD_DEPLOY ) /crd | $(KUBECTL_CMD ) delete --force -f - || true
1762
1764
@echo " Uninstall CRDs completed"
1763
1765
1766
+
1767
+ .PHONY : helm-patch-crd
1768
+ helm-patch-crd :
1769
+ $(KUBECTL_CMD ) patch customresourcedefinition coherence.coherence.oracle.com \
1770
+ --patch ' {"metadata": {"labels": {"app.kubernetes.io/managed-by": "Helm"}}}'
1771
+ $(KUBECTL_CMD ) patch customresourcedefinition coherence.coherence.oracle.com \
1772
+ --patch ' {"metadata": {"annotations": {"meta.helm.sh/release-name": "operator"}}}'
1773
+ $(KUBECTL_CMD ) patch customresourcedefinition coherence.coherence.oracle.com \
1774
+ --patch ' {"metadata": {"annotations": {"meta.helm.sh/release-namespace": "operator-test"}}}'
1775
+ $(KUBECTL_CMD ) patch customresourcedefinition coherencejob.coherence.oracle.com \
1776
+ --patch ' {"metadata": {"labels": {"app.kubernetes.io/managed-by": "Helm"}}}'
1777
+ $(KUBECTL_CMD ) patch customresourcedefinition coherencejob.coherence.oracle.com \
1778
+ --patch ' {"metadata": {"annotations": {"meta.helm.sh/release-name": "operator"}}}'
1779
+ $(KUBECTL_CMD ) patch customresourcedefinition coherencejob.coherence.oracle.com \
1780
+ --patch ' {"metadata": {"annotations": {"meta.helm.sh/release-namespace": "operator-test"}}}'
1781
+
1764
1782
# ----------------------------------------------------------------------------------------------------------------------
1765
1783
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
1766
1784
# ----------------------------------------------------------------------------------------------------------------------
@@ -1902,19 +1920,21 @@ endef
1902
1920
# Un-deploy controller from the configured Kubernetes cluster in ~/.kube/config
1903
1921
# ----------------------------------------------------------------------------------------------------------------------
1904
1922
.PHONY : undeploy
1905
- undeploy : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests $(TOOLS_BIN ) /kustomize # # Undeploy the Coherence Operator
1923
+ undeploy : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests $(TOOLS_BIN ) /kustomize uninstall-webhooks # # Undeploy the Coherence Operator
1906
1924
@echo " Undeploy Coherence Operator..."
1907
1925
$(call prepare_deploy,$(OPERATOR_IMAGE ) ,$(OPERATOR_NAMESPACE ) )
1908
1926
$(KUSTOMIZE ) build $(BUILD_DEPLOY ) /default | $(KUBECTL_CMD ) delete -f - || true
1909
- $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) delete secret coherence-webhook-server-cert || true
1910
- $(KUBECTL_CMD ) delete mutatingwebhookconfiguration coherence-operator-mutating-webhook-configuration || true
1911
- $(KUBECTL_CMD ) delete validatingwebhookconfiguration coherence-operator-validating-webhook-configuration || true
1912
1927
$(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) delete secret coherence-operator-pull-secret || true
1913
1928
@echo " Undeploy Coherence Operator completed"
1914
1929
@echo " Uninstalling CRDs - executing deletion"
1915
1930
$(KUSTOMIZE ) build $(BUILD_DEPLOY ) /crd | $(KUBECTL_CMD ) delete --force -f - || true
1916
1931
@echo " Uninstall CRDs completed"
1917
1932
1933
+ .PHONY : uninstall-webhooks
1934
+ uninstall-webhooks :
1935
+ $(KUBECTL_CMD ) -n $(OPERATOR_NAMESPACE ) delete secret coherence-webhook-server-cert || true
1936
+ $(KUBECTL_CMD ) delete mutatingwebhookconfiguration coherence-operator-mutating-webhook-configuration || true
1937
+ $(KUBECTL_CMD ) delete validatingwebhookconfiguration coherence-operator-validating-webhook-configuration || true
1918
1938
1919
1939
# ----------------------------------------------------------------------------------------------------------------------
1920
1940
# Tail the deployed operator logs.
@@ -2087,7 +2107,7 @@ create-ssl-secrets: $(BUILD_OUTPUT)/certs
2087
2107
# #@ KinD
2088
2108
2089
2109
KIND_CLUSTER ?= operator
2090
- KIND_IMAGE ?= "kindest/node:v1.32.0 @sha256:c48c62eac5da28cdadcf560d1d8616cfa6783b58f0d94cf63ad1bf49600cb027 "
2110
+ KIND_IMAGE ?= "kindest/node:v1.32.2 @sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f "
2091
2111
CALICO_TIMEOUT ?= 300s
2092
2112
KIND_SCRIPTS := $(SCRIPTS_DIR ) /kind
2093
2113
@@ -2181,7 +2201,7 @@ K3D_REGISTRY_PORT ?= 12345
2181
2201
K3D_INTERNAL_REGISTRY := k3d-$(K3D_REGISTRY ) .localhost:$(K3D_REGISTRY_PORT )
2182
2202
2183
2203
.PHONY : k3d
2184
- k3d : $(TOOLS_BIN ) /k3d k3d-create k3d-load-operator create-namespace # # Run a default k3d cluster
2204
+ k3d : $(TOOLS_BIN ) /k3d k3d-create k3d-load-operator k3d-load-coherence create-namespace # # Run a default k3d cluster
2185
2205
2186
2206
.PHONY : k3d-create
2187
2207
k3d-create : $(TOOLS_BIN ) /k3d # # Create the k3d cluster
@@ -2203,6 +2223,7 @@ k3d-load-operator: $(TOOLS_BIN)/k3d ## Load the Operator images into the k3d cl
2203
2223
2204
2224
.PHONY : k3d-load-coherence
2205
2225
k3d-load-coherence : $(TOOLS_BIN ) /k3d # # Load the Coherence images into the k3d cluster
2226
+ $(DOCKER_CMD ) pull $(COHERENCE_IMAGE )
2206
2227
$(TOOLS_BIN ) /k3d image import $(COHERENCE_IMAGE ) -c $(K3D_CLUSTER )
2207
2228
2208
2229
.PHONY : k3d-load-all
0 commit comments