@@ -32,7 +32,7 @@ COMPATIBLE_SELECTOR = control-plane=coherence
3232# The GitHub project URL
3333PROJECT_URL = https://github.com/oracle/coherence-operator
3434
35- KUBERNETES_DOC_VERSION =v1.26
35+ KUBERNETES_DOC_VERSION =v1.28
3636
3737# ----------------------------------------------------------------------------------------------------------------------
3838# The Coherence image to use for deployments that do not specify an image
@@ -325,6 +325,7 @@ GOS = $(shell find . -type f -name "*.go" ! -name "*_test.go")
325325HELM_FILES = $(shell find helm-charts/coherence-operator -type f)
326326API_GO_FILES = $(shell find . -type f -name "* .go" ! -name "* _test.go" ! -name "zz* .go")
327327CRDV1_FILES = $(shell find ./config/crd -type f)
328+ JAVA_FILES = $(shell find ./java -type f)
328329
329330TEST_SSL_SECRET := coherence-ssl-secret
330331
@@ -431,7 +432,7 @@ clean-tools: ## Cleans the locally downloaded build tools (i.e. need a new tool
431432.PHONY : build-operator
432433build-operator : $(BUILD_TARGETS ) /build-operator # # Build the Coherence Operator image
433434
434- $(BUILD_TARGETS ) /build-operator : $(BUILD_BIN ) /runner build-mvn coherence- cli
435+ $(BUILD_TARGETS ) /build-operator : $(BUILD_BIN ) /runner $( BUILD_TARGETS ) /java $( BUILD_TARGETS ) / cli
435436 docker build --no-cache --build-arg version=$(VERSION ) \
436437 --build-arg BASE_IMAGE=$(OPERATOR_BASE_IMAGE ) \
437438 --build-arg coherence_image=$(COHERENCE_IMAGE ) \
@@ -448,7 +449,7 @@ $(BUILD_TARGETS)/build-operator: $(BUILD_BIN)/runner build-mvn coherence-cli
448449 touch $(BUILD_TARGETS ) /build-operator
449450
450451.PHONY : build-operator-with-tools
451- build-operator-with-tools : $(BUILD_BIN ) /runner build-mvn # # Build the Coherence Operator image on OL-8 with debug tools
452+ build-operator-with-tools : $(BUILD_BIN ) /runner $( BUILD_TARGETS ) /java # # Build the Coherence Operator image on OL-8 with debug tools
452453 mkdir -p $(BUILD_OUTPUT ) /images || true
453454 cat Dockerfile debug/Tools.Dockerfile > $(BUILD_OUTPUT ) /images/Dockerfile
454455 docker build --no-cache --build-arg version=$(VERSION ) \
@@ -460,7 +461,7 @@ build-operator-with-tools: $(BUILD_BIN)/runner build-mvn ## Build the Coherence
460461 . -t $(OPERATOR_IMAGE )
461462
462463.PHONY : build-operator-debug
463- build-operator-debug : $(BUILD_BIN ) /linux/amd64/runner-debug build-mvn # # Build the Coherence Operator image with the Delve debugger
464+ build-operator-debug : $(BUILD_BIN ) /linux/amd64/runner-debug $( BUILD_TARGETS ) /java # # Build the Coherence Operator image with the Delve debugger
464465 docker build --no-cache --build-arg version=$(VERSION ) \
465466 --build-arg BASE_IMAGE=$(OPERATOR_IMAGE_DELVE ) \
466467 --build-arg coherence_image=$(COHERENCE_IMAGE ) \
@@ -486,7 +487,7 @@ build-operator-images: $(BUILD_TARGETS)/build-operator ## Build all operator ima
486487# Build the Operator Test images
487488# ----------------------------------------------------------------------------------------------------------------------
488489.PHONY : build-test-images
489- build-test-images : build-mvn build-client-image build-basic-test-image # # Build all of the test images
490+ build-test-images : $( BUILD_TARGETS ) /java build-client-image build-basic-test-image # # Build all of the test images
490491 ./mvnw -B -f java/operator-test-helidon package jib:dockerBuild -DskipTests -Djib.to.image=$(TEST_APPLICATION_IMAGE_HELIDON ) $(MAVEN_BUILD_OPTS )
491492 ./mvnw -B -f java/operator-test-spring package jib:dockerBuild -DskipTests -Djib.to.image=$(TEST_APPLICATION_IMAGE_SPRING ) $(MAVEN_BUILD_OPTS )
492493 ./mvnw -B -f java/operator-test-spring package spring-boot:build-image -DskipTests -Dcnbp-image-name=$(TEST_APPLICATION_IMAGE_SPRING_CNBP ) $(MAVEN_BUILD_OPTS )
@@ -500,7 +501,7 @@ build-test-images: build-mvn build-client-image build-basic-test-image ## Build
500501# Build the basic Operator Test image
501502# ----------------------------------------------------------------------------------------------------------------------
502503.PHONY : build-basic-test-image
503- build-basic-test-image : build-mvn # # Build the basic Operator test image
504+ build-basic-test-image : $( BUILD_TARGETS ) /java # # Build the basic Operator test image
504505 ./mvnw -B -f java/operator-test clean package jib:dockerBuild -DskipTests -Djib.to.image=$(TEST_APPLICATION_IMAGE ) $(MAVEN_BUILD_OPTS ) -Dcoherence.version=$(COHERENCE_IMAGE_TAG )
505506
506507.PHONY : build-client-image
@@ -538,16 +539,20 @@ $(BUILD_BIN)/runner: $(BUILD_PROPS) $(GOS) $(BUILD_TARGETS)/generate $(BUILD_TAR
538539# Build the Java artifacts
539540# ----------------------------------------------------------------------------------------------------------------------
540541.PHONY : build-mvn
541- build-mvn : # # Build the Java artefacts
542+ build-mvn : $(BUILD_TARGETS ) /java # # Build the Java artefacts
543+
544+ $(BUILD_TARGETS ) /java : $(JAVA_FILES )
542545 ./mvnw -B -f java clean install -DskipTests $(MAVEN_BUILD_OPTS )
546+ touch $(BUILD_TARGETS ) /java
547+
543548
544549# ---------------------------------------------------------------------------
545550# Build the Coherence operator Helm chart and package it into a tar.gz
546551# ---------------------------------------------------------------------------
547552.PHONY : helm-chart
548553helm-chart : $(BUILD_PROPS ) $(BUILD_HELM ) /coherence-operator-$(VERSION ) .tgz # # Build the Coherence Operator Helm chart
549554
550- $(BUILD_HELM ) /coherence-operator-$(VERSION ) .tgz : $(BUILD_PROPS ) $(HELM_FILES ) $(BUILD_TARGETS ) /generate $(BUILD_TARGETS ) /manifests kustomize
555+ $(BUILD_HELM ) /coherence-operator-$(VERSION ) .tgz : $(BUILD_PROPS ) $(HELM_FILES ) $(BUILD_TARGETS ) /generate $(BUILD_TARGETS ) /manifests $( TOOLS_BIN ) / kustomize
551556# Copy the Helm chart from the source location to the distribution folder
552557 -mkdir -p $(BUILD_HELM)
553558 cp -R ./helm-charts/coherence-operator $(BUILD_HELM)
@@ -587,7 +592,7 @@ manifests: $(BUILD_TARGETS)/manifests ## Generate the CustomResourceDefinition a
587592$(BUILD_TARGETS ) /manifests : $(BUILD_PROPS ) config/crd/bases/coherence.oracle.com_coherence.yaml docs/about/04_coherence_spec.adoc $(BUILD_MANIFESTS_PKG )
588593 touch $(BUILD_TARGETS ) /manifests
589594
590- config/crd/bases/coherence.oracle.com_coherence.yaml : kustomize $(API_GO_FILES ) controller-gen
595+ config/crd/bases/coherence.oracle.com_coherence.yaml : $( TOOLS_BIN ) / kustomize $(API_GO_FILES ) $( TOOLS_BIN ) / controller-gen
591596 $(CONTROLLER_GEN ) " crd:crdVersions={v1}" \
592597 rbac:roleName=manager-role paths=" {./api/...,./controllers/...}" \
593598 output:crd:dir=config/crd/bases
@@ -621,7 +626,7 @@ generate: $(BUILD_TARGETS)/generate ## Run Kubebuilder code and configuration g
621626$(BUILD_TARGETS ) /generate : $(BUILD_PROPS ) $(BUILD_OUTPUT ) /config.json api/v1/zz_generated.deepcopy.go
622627 touch $(BUILD_TARGETS ) /generate
623628
624- api/v1/zz_generated.deepcopy.go : $(API_GO_FILES ) controller-gen
629+ api/v1/zz_generated.deepcopy.go : $(API_GO_FILES ) $( TOOLS_BIN ) / controller-gen
625630 $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./api/..."
626631
627632# ----------------------------------------------------------------------------------------------------------------------
@@ -787,7 +792,7 @@ stop: ## kill any locally running operator process
787792# Generate bundle manifests and metadata, then validate generated files.
788793# ----------------------------------------------------------------------------------------------------------------------
789794.PHONY : bundle
790- bundle : $(BUILD_PROPS ) ensure-sdk kustomize $(BUILD_TARGETS ) /manifests # # Generate OLM bundle manifests and metadata, then validate generated files.
795+ bundle : $(BUILD_PROPS ) ensure-sdk $( TOOLS_BIN ) / kustomize $(BUILD_TARGETS ) /manifests # # Generate OLM bundle manifests and metadata, then validate generated files.
791796 $(OPERATOR_SDK ) generate kustomize manifests -q
792797 cd config/manager && $(KUSTOMIZE ) edit set image controller=$(OPERATOR_IMAGE )
793798 $(KUSTOMIZE ) build config/manifests | $(OPERATOR_SDK ) generate bundle -q --overwrite --version $(VERSION ) $(BUNDLE_METADATA_OPTS )
@@ -869,7 +874,7 @@ test-operator: $(BUILD_PROPS) $(BUILD_TARGETS)/manifests $(BUILD_TARGETS)/genera
869874# Build and test the Java artifacts
870875# ----------------------------------------------------------------------------------------------------------------------
871876.PHONY : test-mvn
872- test-mvn : $(BUILD_OUTPUT ) /certs build-mvn # # Run the Java artefact tests
877+ test-mvn : $(BUILD_OUTPUT ) /certs $( BUILD_TARGETS ) /java # # Run the Java artefact tests
873878 ./mvnw -B -f java verify -Dtest.certs.location=$(BUILD_OUTPUT ) /certs $(MAVEN_BUILD_OPTS )
874879
875880
@@ -1305,7 +1310,7 @@ deploy-and-wait: deploy wait-for-deploy ## Deploy the Coherence Operator and w
13051310OPERATOR_HA ?= true
13061311
13071312.PHONY : deploy
1308- deploy : prepare-deploy create-namespace kustomize # # Deploy the Coherence Operator
1313+ deploy : prepare-deploy create-namespace $( TOOLS_BIN ) / kustomize # # Deploy the Coherence Operator
13091314ifneq (,$(WATCH_NAMESPACE ) )
13101315 cd $(BUILD_DEPLOY)/manager && $(KUSTOMIZE) edit add configmap env-vars --from-literal WATCH_NAMESPACE=$(WATCH_NAMESPACE)
13111316endif
@@ -1322,11 +1327,11 @@ just-deploy: ## Deploy the Coherence Operator without rebuilding anything
13221327 $(KUSTOMIZE ) build $(BUILD_DEPLOY ) /default | kubectl apply -f -
13231328
13241329.PHONY : prepare-deploy
1325- prepare-deploy : $(BUILD_TARGETS ) /manifests $(BUILD_TARGETS ) /build-operator kustomize
1330+ prepare-deploy : $(BUILD_TARGETS ) /manifests $(BUILD_TARGETS ) /build-operator $( TOOLS_BIN ) / kustomize
13261331 $(call prepare_deploy,$(OPERATOR_IMAGE ) ,$(OPERATOR_NAMESPACE ) )
13271332
13281333.PHONY : deploy-debug
1329- deploy-debug : prepare-deploy-debug create-namespace kustomize # # Deploy the Coherence Operator running with Delve
1334+ deploy-debug : prepare-deploy-debug create-namespace $( TOOLS_BIN ) / kustomize # # Deploy the Coherence Operator running with Delve
13301335ifneq (,$(WATCH_NAMESPACE ) )
13311336 cd $(BUILD_DEPLOY)/manager && $(KUSTOMIZE) edit add configmap env-vars --from-literal WATCH_NAMESPACE=$(WATCH_NAMESPACE)
13321337endif
@@ -1356,7 +1361,7 @@ port-forward-debug: ## Run a port-forward process to forward localhost:2345 to
13561361 kubectl -n $(OPERATOR_NAMESPACE ) port-forward $(POD ) 2345:2345 || true
13571362
13581363.PHONY : prepare-deploy-debug
1359- prepare-deploy-debug : $(BUILD_TARGETS ) /manifests build-operator-debug kustomize
1364+ prepare-deploy-debug : $(BUILD_TARGETS ) /manifests build-operator-debug $( TOOLS_BIN ) / kustomize
13601365 $(call prepare_deploy,$(OPERATOR_IMAGE_DEBUG ) ,$(OPERATOR_NAMESPACE ) )
13611366
13621367.PHONY : wait-for-deploy
@@ -1387,7 +1392,7 @@ endef
13871392# Un-deploy controller from the configured Kubernetes cluster in ~/.kube/config
13881393# ----------------------------------------------------------------------------------------------------------------------
13891394.PHONY : undeploy
1390- undeploy : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests kustomize # # Undeploy the Coherence Operator
1395+ undeploy : $(BUILD_PROPS ) $(BUILD_TARGETS ) /manifests $( TOOLS_BIN ) / kustomize # # Undeploy the Coherence Operator
13911396 @echo " Undeploy Coherence Operator..."
13921397 $(call prepare_deploy,$(OPERATOR_IMAGE ) ,$(OPERATOR_NAMESPACE ) )
13931398 $(KUSTOMIZE ) build $(BUILD_DEPLOY ) /default | kubectl delete -f - || true
@@ -1406,7 +1411,7 @@ tail-logs: ## Tail the Coherence Operator Pod logs (with follow)
14061411 kubectl -n $(OPERATOR_NAMESPACE ) logs $(POD ) -c manager -f
14071412
14081413
1409- $(BUILD_MANIFESTS_PKG ) : kustomize
1414+ $(BUILD_MANIFESTS_PKG ) : $( TOOLS_BIN ) / kustomize
14101415 rm -rf $(BUILD_MANIFESTS ) || true
14111416 mkdir -p $(BUILD_MANIFESTS ) /crd
14121417 $(KUSTOMIZE ) build config/crd > $(BUILD_MANIFESTS ) /crd/coherence.oracle.com_coherence.yaml
@@ -1728,7 +1733,7 @@ tanzu-delete-cluster: ## Delete the local Tanzu unmanaged cluster named "$(KIND_
17281733 $(TANZU ) uc delete $(KIND_CLUSTER )
17291734
17301735.PHONY : tanzu-package-internal
1731- tanzu-package-internal : $(BUILD_PROPS ) $(BUILD_TARGETS ) /generate $(BUILD_TARGETS ) /manifests kustomize
1736+ tanzu-package-internal : $(BUILD_PROPS ) $(BUILD_TARGETS ) /generate $(BUILD_TARGETS ) /manifests $( TOOLS_BIN ) / kustomize
17321737 rm -r $(TANZU_PACKAGE_DIR ) || true
17331738 mkdir -p $(TANZU_PACKAGE_DIR ) /config $(TANZU_PACKAGE_DIR ) /.imgpkg || true
17341739 cp -vR tanzu/package/* $(TANZU_PACKAGE_DIR ) /config/
@@ -1826,7 +1831,9 @@ endif
18261831# ----------------------------------------------------------------------------------------------------------------------
18271832.PHONY : controller-gen
18281833CONTROLLER_GEN = $(TOOLS_BIN ) /controller-gen
1829- controller-gen : # # Download controller-gen locally if necessary.
1834+ controller-gen : $(TOOLS_BIN ) /controller-gen # # Download controller-gen locally if necessary.
1835+
1836+ $(TOOLS_BIN ) /controller-gen :
18301837 @echo " Downloading controller-gen"
18311838 test -s
$(TOOLS_BIN ) /controller-gen
|| GOBIN=
$(TOOLS_BIN ) go install sigs.k8s.io/controller-tools/cmd/
[email protected] 18321839 ls -al $(TOOLS_BIN )
@@ -1839,14 +1846,19 @@ KUSTOMIZE_VERSION ?= v3.8.7
18391846
18401847.PHONY : kustomize
18411848KUSTOMIZE = $(TOOLS_BIN ) /kustomize
1842- kustomize : # # Download kustomize locally if necessary.
1849+ kustomize : $(TOOLS_BIN ) /kustomize # # Download kustomize locally if necessary.
1850+
1851+ $(TOOLS_BIN ) /kustomize :
18431852 test -s $(TOOLS_BIN ) /kustomize || { curl -Ss $( KUSTOMIZE_INSTALL_SCRIPT) --header $( GH_AUTH) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( TOOLS_BIN) ; }
18441853
18451854# ----------------------------------------------------------------------------------------------------------------------
18461855# find or download the Coherence CLI
18471856# ----------------------------------------------------------------------------------------------------------------------
18481857.PHONY : coherence-cli
1849- coherence-cli : $(BUILD_BIN_AMD64 ) /cohctl $(BUILD_BIN_ARM64 ) /cohctl # # Download the Coherence CLI locally if necessary.
1858+ coherence-cli : $(BUILD_TARGETS ) /cli # # Download the Coherence CLI locally if necessary.
1859+
1860+ $(BUILD_TARGETS ) /cli : $(BUILD_BIN_AMD64 ) /cohctl $(BUILD_BIN_ARM64 ) /cohctl
1861+ touch $(BUILD_TARGETS ) /cli
18501862
18511863$(BUILD_BIN_AMD64 ) /cohctl : export COHCTL_HOME=$(BUILD_BIN_AMD64 )
18521864$(BUILD_BIN_AMD64 ) /cohctl : export OS=Linux
@@ -1948,7 +1960,7 @@ push-ttl-test-images:
19481960# Build the Operator Test images
19491961# ----------------------------------------------------------------------------------------------------------------------
19501962.PHONY : build-compatibility-image
1951- build-compatibility-image : build-mvn
1963+ build-compatibility-image : $( BUILD_TARGETS ) /java
19521964 ./mvnw -B -f java/operator-compatibility package -DskipTests \
19531965 -Dcoherence.compatibility.image.name=$(TEST_COMPATIBILITY_IMAGE ) \
19541966 -Dcoherence.compatibility.coherence.image=$(COHERENCE_IMAGE ) $(MAVEN_BUILD_OPTS )
@@ -2105,7 +2117,7 @@ install-istio: get-istio ## Install the latest version of Istio into k8s (or ove
21052117.PHONY : uninstall-istio
21062118uninstall-istio : get-istio # # Uninstall Istio from k8s
21072119 $(eval ISTIO_HOME := $(shell find $(TOOLS_DIRECTORY ) -maxdepth 1 -type d | grep istio) )
2108- $(ISTIO_HOME ) /bin/istioctl x uninstall --purge -y
2120+ $(ISTIO_HOME ) /bin/istioctl uninstall --purge -y
21092121
21102122
21112123# ----------------------------------------------------------------------------------------------------------------------
0 commit comments