From cd4dc31659afddc79633f77a24167ea941d93f2d Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:55:13 +0300 Subject: [PATCH 01/26] feat(build): add short summaries to targets Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 335 +++++++++++++++++++++++++++---------------------------- 1 file changed, 163 insertions(+), 172 deletions(-) diff --git a/Makefile b/Makefile index 7fc382ed..f7935eed 100644 --- a/Makefile +++ b/Makefile @@ -120,21 +120,28 @@ ifneq ("$(wildcard $(GINKGO))","") GO_TEST="$(GINKGO)" -cover -output-dir=. endif +##@ General + .PHONY: all all: manager -# Run tests -.PHONY: test +.PHONY: help +help: ## Display this help. + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + +##@ Tests + +.PHONY: test ## Run tests. test: test-envtest test-scorecard .PHONY: test-envtest -test-envtest: generate manifests fmt vet setup-envtest +test-envtest: generate manifests fmt vet setup-envtest ## Run tests using envtest. ifneq ($(SKIP_TESTS), true) KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GO_TEST) -v -coverprofile cover.out ./... endif .PHONY: test-scorecard -test-scorecard: check_cert_manager kustomize operator-sdk +test-scorecard: check_cert_manager kustomize operator-sdk ## Run scorecard tests. ifneq ($(SKIP_TESTS), true) $(call scorecard-setup) $(call scorecard-cleanup); \ @@ -143,7 +150,7 @@ ifneq ($(SKIP_TESTS), true) endif .PHONY: clean-scorecard -clean-scorecard: operator-sdk +clean-scorecard: operator-sdk ## Clean up scorecard resources. - $(call scorecard-cleanup); cleanup ifneq ($(and $(SCORECARD_REGISTRY_SERVER),$(SCORECARD_REGISTRY_USERNAME),$(SCORECARD_REGISTRY_PASSWORD)),) @@ -177,135 +184,167 @@ function cleanup { \ } endef -# Build manager binary +##@ Build + .PHONY: manager -manager: manifests generate fmt vet +manager: manifests generate fmt vet ## Build the manager binary. go build -o bin/manager internal/main.go -# Run against the configured Kubernetes cluster in ~/.kube/config .PHONY: run -run: manifests generate fmt vet +run: manifests generate fmt vet ## Run against the configured Kubernetes cluster in ~/.kube/config go run ./internal/main.go ifndef ignore-not-found ignore-not-found = false endif -# Install CRDs into a cluster -.PHONY: install -install: manifests kustomize - $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) apply -f - - -# Uninstall CRDs from a cluster -.PHONY: uninstall -uninstall: manifests kustomize - - $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: custom-scorecard-tests +custom-scorecard-tests: fmt vet ## Build custom scorecard tests. + cd internal/images/custom-scorecard-tests/ && \ + go build -o bin/cryostat-scorecard-tests main.go -.PHONY: predeploy -predeploy: - cd config/manager && $(KUSTOMIZE) edit set image controller=$(OPERATOR_IMG) - cd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE) +.PHONY: scorecard-build +scorecard-build: custom-scorecard-tests ## Build the custom scorecard OCI image. + printf '# Code generated by hack/custom.config.yaml.in. DO NOT EDIT.\n' > config/scorecard/patches/custom.config.yaml + envsubst < hack/custom.config.yaml.in >> config/scorecard/patches/custom.config.yaml +# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile + sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' internal/images/custom-scorecard-tests/Dockerfile > internal/images/custom-scorecard-tests/Dockerfile.cross +ifeq ($(IMAGE_BUILDER), docker) + - $(IMAGE_BUILDER) buildx create --name project-v3-builder + $(IMAGE_BUILDER) buildx use project-v3-builder + - $(IMAGE_BUILDER) buildx build --push --platform=$(PLATFORMS) --tag $(CUSTOM_SCORECARD_IMG) -f internal/images/custom-scorecard-tests/Dockerfile.cross . + - $(IMAGE_BUILDER) buildx rm project-v3-builder +else ifeq ($(IMAGE_BUILDER), podman) + BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build -f internal/images/custom-scorecard-tests/Dockerfile.cross --manifest $(CUSTOM_SCORECARD_IMG) --platform $(PLATFORMS) . ; \ + if [ "${MANIFEST_PUSH}" = "true" ] ; then \ + $(IMAGE_BUILDER) manifest push $(CUSTOM_SCORECARD_IMG) $(CUSTOM_SCORECARD_IMG) ; \ + fi +else + $(error unsupported IMAGE_BUILDER: $(IMAGE_BUILDER)) +endif + rm internal/images/custom-scorecard-tests/Dockerfile.cross -.PHONY: print_deploy_config -print_deploy_config: predeploy - $(KUSTOMIZE) build config/default +.PHONY: oci-build +oci-build: manifests generate fmt vet test-envtest ## Build the OCI image. + BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build --build-arg TARGETOS=$(OS) --build-arg TARGETARCH=$(ARCH) -t $(OPERATOR_IMG) . -# Deploy controller in the configured Kubernetes cluster in ~/.kube/config -.PHONY: deploy -deploy: check_cert_manager manifests kustomize predeploy - $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) apply -f - -ifeq ($(DISABLE_SERVICE_TLS), true) - @echo "Disabling TLS for in-cluster communication between Services" - @$(CLUSTER_CLIENT) -n $(DEPLOY_NAMESPACE) set env deployment/cryostat-operator-controller-manager DISABLE_SERVICE_TLS=true +# You need to be able to push the image for your registry (i.e. if you do not inform a valid value via OPERATOR_IMG=> than the export will fail) +# If IMAGE_BUILDER is docker, you need to: +# - able to use docker buildx. More info: https://docs.docker.com/build/buildx/ +# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/ +# To properly provided solutions that supports more than one platform you should use this option. +.PHONY: oci-buildx +oci-buildx: manifests generate fmt vet test-envtest ## Build OCI image for the manager for cross-platform support. +# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile + sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross +ifeq ($(IMAGE_BUILDER), docker) + - $(IMAGE_BUILDER) buildx create --name project-v3-builder + $(IMAGE_BUILDER) buildx use project-v3-builder + - $(IMAGE_BUILDER) buildx build --push --platform=$(PLATFORMS) --tag $(OPERATOR_IMG) -f Dockerfile.cross . + - $(IMAGE_BUILDER) buildx rm project-v3-builder +else ifeq ($(IMAGE_BUILDER), podman) + BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build -f Dockerfile.cross --manifest $(OPERATOR_IMG) --platform $(PLATFORMS) . ; \ + if [ "${MANIFEST_PUSH}" = "true" ] ; then \ + $(IMAGE_BUILDER) manifest push $(OPERATOR_IMG) $(OPERATOR_IMG) ; \ + fi +else + $(error unsupported IMAGE_BUILDER: $(IMAGE_BUILDER)) endif + rm Dockerfile.cross -# Undeploy controller from the configured Kubernetes cluster in ~/.kube/config -.PHONY: undeploy -undeploy: - - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml - - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml - - $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: catalog-build +catalog-build: opm ## Build for catalog. + $(OPM) index add --container-tool $(IMAGE_BUILDER) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) + +.PHONY: bundle +bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files. + $(OPERATOR_SDK) generate kustomize manifests -q + cd config/manager && $(KUSTOMIZE) edit set image controller=$(OPERATOR_IMG) + $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) + $(OPERATOR_SDK) bundle validate ./bundle + +.PHONY: bundle-build +bundle-build: ## Build the bundle image. + $(IMAGE_BUILDER) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . + +##@ Development -# Generate manifests e.g. CRD, RBAC etc. .PHONY: manifests -manifests: controller-gen +manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc. $(CONTROLLER_GEN) rbac:roleName=role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases envsubst < hack/image_tag_patch.yaml.in > config/default/image_tag_patch.yaml envsubst < hack/image_pull_patch.yaml.in > config/default/image_pull_patch.yaml -# Run go fmt against code .PHONY: fmt -fmt: add-license +fmt: add-license ## Run go fmt against code. go fmt ./... -# Run go vet against code .PHONY: vet -vet: +vet: ## Run go vet against code. go vet ./... -# Generate code .PHONY: generate -generate: controller-gen +generate: controller-gen ## Generate code. go generate ./... $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." -# Check and add (if missing) license header LICENSE_FILE = $(shell pwd)/LICENSE GO_PACKAGES := $(shell go list -test -f '{{.Dir}}' ./... | sed -e "s|^$$(pwd)||" | cut -d/ -f2 | sort -u) .PHONY: check-license -check-license: golicense +check-license: golicense ## Check and add (if missing) license header. @echo "Checking license..." $(GOLICENSE) --config=go-license.yml --verify $(shell find ${GO_PACKAGES} -name "*.go") .PHONY: add-license -add-license: golicense +add-license: golicense ## Add license headers to code files. @echo "Adding license..." $(GOLICENSE) --config=go-license.yml $(shell find ${GO_PACKAGES} -name "*.go") .PHONY: remove-license -remove-license: golicense +remove-license: golicense ## Remove license headers from code files. @echo "Removing license..." $(GOLICENSE) --config=go-license.yml --remove $(shell find ${GO_PACKAGES} -name "*.go") -# Build the OCI image -.PHONY: oci-build -oci-build: manifests generate fmt vet test-envtest - BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build --build-arg TARGETOS=$(OS) --build-arg TARGETARCH=$(ARCH) -t $(OPERATOR_IMG) . - -# You need to be able to push the image for your registry (i.e. if you do not inform a valid value via OPERATOR_IMG=> than the export will fail) -# If IMAGE_BUILDER is docker, you need to: -# - able to use docker buildx. More info: https://docs.docker.com/build/buildx/ -# - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/ -# To properly provided solutions that supports more than one platform you should use this option. -.PHONY: oci-buildx -oci-buildx: manifests generate fmt vet test-envtest ## Build OCI image for the manager for cross-platform support -# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile - sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross -ifeq ($(IMAGE_BUILDER), docker) - - $(IMAGE_BUILDER) buildx create --name project-v3-builder - $(IMAGE_BUILDER) buildx use project-v3-builder - - $(IMAGE_BUILDER) buildx build --push --platform=$(PLATFORMS) --tag $(OPERATOR_IMG) -f Dockerfile.cross . - - $(IMAGE_BUILDER) buildx rm project-v3-builder -else ifeq ($(IMAGE_BUILDER), podman) - BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build -f Dockerfile.cross --manifest $(OPERATOR_IMG) --platform $(PLATFORMS) . ; \ - if [ "${MANIFEST_PUSH}" = "true" ] ; then \ - $(IMAGE_BUILDER) manifest push $(OPERATOR_IMG) $(OPERATOR_IMG) ; \ - fi -else - $(error unsupported IMAGE_BUILDER: $(IMAGE_BUILDER)) +# Local development/testing helpers +ifneq ($(origin SAMPLE_APP_NAMESPACE), undefined) +SAMPLE_APP_FLAGS += -n $(SAMPLE_APP_NAMESPACE) endif - rm Dockerfile.cross + +.PHONY: sample_app +sample_app: ## Deploy sample app. + $(CLUSTER_CLIENT) apply $(SAMPLE_APP_FLAGS) -f config/samples/sample-app.yaml + +.PHONY: undeploy_sample_app +undeploy_sample_app: ## Undeploy sample app. + $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app.yaml + +.PHONY: sample_app_agent +sample_app_agent: undeploy_sample_app_agent ## Deploy sample app agent. + @if [ -z "${AUTH_TOKEN}" ]; then \ + if [ "${CLUSTER_CLIENT}" = "oc" ]; then\ + AUTH_TOKEN=`oc whoami -t | base64`; \ + else \ + echo "'AUTH_TOKEN' must be specified."; \ + exit 1; \ + fi; \ + fi; \ + $(CLUSTER_CLIENT) apply $(SAMPLE_APP_FLAGS) -f config/samples/sample-app-agent.yaml; \ + $(CLUSTER_CLIENT) set env $(SAMPLE_APP_FLAGS) deployment/quarkus-test-agent CRYOSTAT_AGENT_AUTHORIZATION="Bearer $(AUTH_TOKEN)" + +.PHONY: undeploy_sample_app_agent +undeploy_sample_app_agent: ## Undeploy sample app agent. + - $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app-agent.yaml .PHONY: cert_manager -cert_manager: remove_cert_manager +cert_manager: remove_cert_manager ## Restart cert manager. $(CLUSTER_CLIENT) create --validate=false -f $(CERT_MANAGER_MANIFEST) .PHONY: remove_cert_manager -remove_cert_manager: +remove_cert_manager: ## Remove cert manager. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f $(CERT_MANAGER_MANIFEST) .PHONY: check_cert_manager -check_cert_manager: +check_cert_manager: ## Check cert manager. @api_versions=$$($(CLUSTER_CLIENT) api-versions) &&\ if [ $$(echo "$${api_versions}" | grep -c '^cert-manager.io/v1$$') -eq 0 ]; then\ if [ "$${DISABLE_SERVICE_TLS}" != "true" ]; then\ @@ -313,25 +352,24 @@ check_cert_manager: fi;\ fi -# Location to install dependencies +##@ Build Dependencies + LOCALBIN ?= $(shell pwd)/bin PHONY: local-bin -local-bin: +local-bin: ## Location to install dependencies. mkdir -p $(LOCALBIN) -# Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten. CONTROLLER_GEN = $(LOCALBIN)/controller-gen .PHONY: controller-gen -controller-gen: $(CONTROLLER_GEN) +controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten. $(CONTROLLER_GEN): local-bin test -s $(CONTROLLER_GEN) && $(CONTROLLER_GEN) --version | grep -q $(CONTROLLER_TOOLS_VERSION) || \ GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CONTROLLER_TOOLS_VERSION) -# Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading. KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" KUSTOMIZE = $(LOCALBIN)/kustomize .PHONY: kustomize -kustomize: $(KUSTOMIZE) +kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading. $(KUSTOMIZE): local-bin @if test -x $(LOCALBIN)/kustomize && ! $(LOCALBIN)/kustomize version | grep -q $(KUSTOMIZE_VERSION); then \ echo "$(LOCALBIN)/kustomize version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \ @@ -339,24 +377,21 @@ $(KUSTOMIZE): local-bin fi test -s $(KUSTOMIZE) || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); } -# Download go-license locally if necessary GOLICENSE = $(LOCALBIN)/go-license .PHONY: golicense -golicense: $(GOLICENSE) +golicense: $(GOLICENSE) ## Download go-license locally if necessary. $(GOLICENSE): local-bin test -s $(GOLICENSE) || GOBIN=$(LOCALBIN) go install github.com/palantir/go-license@v$(GOLICENSE_VERSION) -# Download setup-envtest locally if necessary ENVTEST = $(LOCALBIN)/setup-envtest .PHONY: setup-envtest -setup-envtest: $(ENVTEST) +setup-envtest: $(ENVTEST) ## Download setup-envtest locally if necessary. $(ENVTEST): local-bin test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -# Download opm locally if necessary OPM = $(LOCALBIN)/opm .PHONY: opm -opm: $(OPM) +opm: $(OPM) ## Download opm locally if necessary. $(OPM): local-bin test -s $(OPM) || \ { \ @@ -365,10 +400,6 @@ $(OPM): local-bin chmod +x $(OPM) ;\ } -.PHONY: catalog-build -catalog-build: opm - $(OPM) index add --container-tool $(IMAGE_BUILDER) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) - .PHONY: operator-sdk OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk operator-sdk: ## Download operator-sdk locally if necessary. @@ -386,21 +417,41 @@ OPERATOR_SDK = $(shell which operator-sdk) endif endif -# Generate bundle manifests and metadata, then validate generated files. -.PHONY: bundle -bundle: manifests kustomize operator-sdk - $(OPERATOR_SDK) generate kustomize manifests -q +##@ Deployment + +.PHONY: install +install: manifests kustomize ## Install CRDs into a cluster. + $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) apply -f - + +.PHONY: uninstall +uninstall: manifests kustomize ## Uninstall CRDs from a cluster. + - $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - + +.PHONY: predeploy +predeploy: ## Prepare for deployment. cd config/manager && $(KUSTOMIZE) edit set image controller=$(OPERATOR_IMG) - $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) - $(OPERATOR_SDK) bundle validate ./bundle + cd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE) -# Build the bundle image. -.PHONY: bundle-build -bundle-build: - $(IMAGE_BUILDER) build -f bundle.Dockerfile -t $(BUNDLE_IMG) . +.PHONY: print_deploy_config +print_deploy_config: predeploy ## Print deployment configuration. + $(KUSTOMIZE) build config/default + +.PHONY: deploy +deploy: check_cert_manager manifests kustomize predeploy ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config + $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) apply -f - +ifeq ($(DISABLE_SERVICE_TLS), true) + @echo "Disabling TLS for in-cluster communication between Services" + @$(CLUSTER_CLIENT) -n $(DEPLOY_NAMESPACE) set env deployment/cryostat-operator-controller-manager DISABLE_SERVICE_TLS=true +endif + +.PHONY: undeploy +undeploy: ## Undeploy controller from the configured Kubernetes cluster in ~/.kube/config + - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml + - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml + - $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: deploy_bundle -deploy_bundle: check_cert_manager undeploy_bundle +deploy_bundle: check_cert_manager undeploy_bundle ## Deploy the bundled image. $(OPERATOR_SDK) run bundle --install-mode $(BUNDLE_INSTALL_MODE) $(BUNDLE_IMG) ifeq ($(DISABLE_SERVICE_TLS), true) @echo "Disabling TLS for in-cluster communication between Services" @@ -418,84 +469,24 @@ ifeq ($(DISABLE_SERVICE_TLS), true) endif .PHONY: undeploy_bundle -undeploy_bundle: operator-sdk +undeploy_bundle: operator-sdk ## Undeploy deployed bundle. - $(OPERATOR_SDK) cleanup $(OPERATOR_NAME) -# Deploy a Cryostat instance .PHONY: create_cryostat_cr -create_cryostat_cr: destroy_cryostat_cr +create_cryostat_cr: destroy_cryostat_cr ## Deploy a Cryostat instance. $(CLUSTER_CLIENT) create -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: create_clustercryostat_cr -create_clustercryostat_cr: destroy_clustercryostat_cr +create_clustercryostat_cr: destroy_clustercryostat_cr ## Deploy a Cryostat cluster. target_ns_json=$$(jq -nc '$$ARGS.positional' --args -- $(TARGET_NAMESPACES)) && \ $(CLUSTER_CLIENT) patch -f config/samples/operator_v1beta1_clustercryostat.yaml --local=true --type=merge \ -p "{\"spec\": {\"installNamespace\": \"$(DEPLOY_NAMESPACE)\", \"targetNamespaces\": $$target_ns_json}}" -o yaml | \ oc apply -f - -# Undeploy a Cryostat instance .PHONY: destroy_cryostat_cr -destroy_cryostat_cr: +destroy_cryostat_cr: ## Undeploy a Cryostat instance. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: destroy_clustercryostat_cr -destroy_clustercryostat_cr: +destroy_clustercryostat_cr: ## Undeploy a Cryostat cluster. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml - -# Build custom scorecard tests -.PHONY: custom-scorecard-tests -custom-scorecard-tests: fmt vet - cd internal/images/custom-scorecard-tests/ && \ - go build -o bin/cryostat-scorecard-tests main.go - -# Build the custom scorecard OCI image -.PHONY: scorecard-build -scorecard-build: custom-scorecard-tests - printf '# Code generated by hack/custom.config.yaml.in. DO NOT EDIT.\n' > config/scorecard/patches/custom.config.yaml - envsubst < hack/custom.config.yaml.in >> config/scorecard/patches/custom.config.yaml -# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile - sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' internal/images/custom-scorecard-tests/Dockerfile > internal/images/custom-scorecard-tests/Dockerfile.cross -ifeq ($(IMAGE_BUILDER), docker) - - $(IMAGE_BUILDER) buildx create --name project-v3-builder - $(IMAGE_BUILDER) buildx use project-v3-builder - - $(IMAGE_BUILDER) buildx build --push --platform=$(PLATFORMS) --tag $(CUSTOM_SCORECARD_IMG) -f internal/images/custom-scorecard-tests/Dockerfile.cross . - - $(IMAGE_BUILDER) buildx rm project-v3-builder -else ifeq ($(IMAGE_BUILDER), podman) - BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build -f internal/images/custom-scorecard-tests/Dockerfile.cross --manifest $(CUSTOM_SCORECARD_IMG) --platform $(PLATFORMS) . ; \ - if [ "${MANIFEST_PUSH}" = "true" ] ; then \ - $(IMAGE_BUILDER) manifest push $(CUSTOM_SCORECARD_IMG) $(CUSTOM_SCORECARD_IMG) ; \ - fi -else - $(error unsupported IMAGE_BUILDER: $(IMAGE_BUILDER)) -endif - rm internal/images/custom-scorecard-tests/Dockerfile.cross - -# Local development/testing helpers -ifneq ($(origin SAMPLE_APP_NAMESPACE), undefined) -SAMPLE_APP_FLAGS += -n $(SAMPLE_APP_NAMESPACE) -endif - -.PHONY: sample_app -sample_app: - $(CLUSTER_CLIENT) apply $(SAMPLE_APP_FLAGS) -f config/samples/sample-app.yaml - -.PHONY: undeploy_sample_app -undeploy_sample_app: - $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app.yaml - -.PHONY: sample_app_agent -sample_app_agent: undeploy_sample_app_agent - @if [ -z "${AUTH_TOKEN}" ]; then \ - if [ "${CLUSTER_CLIENT}" = "oc" ]; then\ - AUTH_TOKEN=`oc whoami -t | base64`; \ - else \ - echo "'AUTH_TOKEN' must be specified."; \ - exit 1; \ - fi; \ - fi; \ - $(CLUSTER_CLIENT) apply $(SAMPLE_APP_FLAGS) -f config/samples/sample-app-agent.yaml; \ - $(CLUSTER_CLIENT) set env $(SAMPLE_APP_FLAGS) deployment/quarkus-test-agent CRYOSTAT_AGENT_AUTHORIZATION="Bearer $(AUTH_TOKEN)" - -.PHONY: undeploy_sample_app_agent -undeploy_sample_app_agent: - - $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app-agent.yaml From 41ce2612700c0c2365f313db653844ed59d3c6a2 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:15:21 +0300 Subject: [PATCH 02/26] Update Makefile Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f7935eed..d6f138c3 100644 --- a/Makefile +++ b/Makefile @@ -199,7 +199,7 @@ ifndef ignore-not-found endif .PHONY: custom-scorecard-tests -custom-scorecard-tests: fmt vet ## Build custom scorecard tests. +custom-scorecard-tests: fmt vet ## Build the custom scorecard binary. cd internal/images/custom-scorecard-tests/ && \ go build -o bin/cryostat-scorecard-tests main.go From 189f96a7a0e935c895c476bc4ed3232df56fc8f8 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:16:25 +0300 Subject: [PATCH 03/26] Update Makefile Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d6f138c3..6aa39831 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,7 @@ endif rm internal/images/custom-scorecard-tests/Dockerfile.cross .PHONY: oci-build -oci-build: manifests generate fmt vet test-envtest ## Build the OCI image. +oci-build: manifests generate fmt vet test-envtest ## Build OCI image for the manager. BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build --build-arg TARGETOS=$(OS) --build-arg TARGETARCH=$(ARCH) -t $(OPERATOR_IMG) . # You need to be able to push the image for your registry (i.e. if you do not inform a valid value via OPERATOR_IMG=> than the export will fail) From 5b1acb90ece925e7c14a350f72b101f4fd7d43ea Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:19:54 +0300 Subject: [PATCH 04/26] Explain podman MANIFEST_PUSH Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6aa39831..658c50ed 100644 --- a/Makefile +++ b/Makefile @@ -228,7 +228,8 @@ endif oci-build: manifests generate fmt vet test-envtest ## Build OCI image for the manager. BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build --build-arg TARGETOS=$(OS) --build-arg TARGETARCH=$(ARCH) -t $(OPERATOR_IMG) . -# You need to be able to push the image for your registry (i.e. if you do not inform a valid value via OPERATOR_IMG=> than the export will fail) +# You may need to be able to push the image for your registry (i.e. if you do not inform a valid value via OPERATOR_IMG=> than the export will fail) +# If using podman, then you can set MANIFEST_PUSH to avoid this behaviour. # If IMAGE_BUILDER is docker, you need to: # - able to use docker buildx. More info: https://docs.docker.com/build/buildx/ # - have enable BuildKit, More info: https://docs.docker.com/develop/develop-images/build_enhancements/ From 1220283075176bd8c22bad9548695cd7b346bc58 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:22:54 +0300 Subject: [PATCH 05/26] controller-gen Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 658c50ed..f665a155 100644 --- a/Makefile +++ b/Makefile @@ -271,7 +271,7 @@ bundle-build: ## Build the bundle image. ##@ Development .PHONY: manifests -manifests: controller-gen ## Generate manifests e.g. CRD, RBAC etc. +manifests: controller-gen ## Generate manifests e.g. CRD, RBAC, etc. $(CONTROLLER_GEN) rbac:roleName=role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases envsubst < hack/image_tag_patch.yaml.in > config/default/image_tag_patch.yaml envsubst < hack/image_pull_patch.yaml.in > config/default/image_pull_patch.yaml From a3dd02c7b747e2dd1a83732eab8e7e0d09e0e81c Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:23:18 +0300 Subject: [PATCH 06/26] controller-gen Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f665a155..bba08e8f 100644 --- a/Makefile +++ b/Makefile @@ -285,7 +285,7 @@ vet: ## Run go vet against code. go vet ./... .PHONY: generate -generate: controller-gen ## Generate code. +generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. go generate ./... $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." From f4593bde9015546f93b2f01246f4677872f638e1 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:25:56 +0300 Subject: [PATCH 07/26] catalog-build Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bba08e8f..34fe5053 100644 --- a/Makefile +++ b/Makefile @@ -254,7 +254,7 @@ endif rm Dockerfile.cross .PHONY: catalog-build -catalog-build: opm ## Build for catalog. +catalog-build: opm ## Build a catalog image. $(OPM) index add --container-tool $(IMAGE_BUILDER) --mode semver --tag $(CATALOG_IMG) --bundles $(BUNDLE_IMGS) $(FROM_INDEX_OPT) .PHONY: bundle From 930c428a0abd4fb03d16ad131fb2363926acb6b4 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:26:33 +0300 Subject: [PATCH 08/26] cert_manager Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34fe5053..93c0e0d4 100644 --- a/Makefile +++ b/Makefile @@ -337,7 +337,7 @@ undeploy_sample_app_agent: ## Undeploy sample app agent. - $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app-agent.yaml .PHONY: cert_manager -cert_manager: remove_cert_manager ## Restart cert manager. +cert_manager: remove_cert_manager ## Install cert manager. $(CLUSTER_CLIENT) create --validate=false -f $(CERT_MANAGER_MANIFEST) .PHONY: remove_cert_manager From e79163b0bef954cc0ade8de252bd6bd559745cea Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:26:47 +0300 Subject: [PATCH 09/26] undeploy_sample_app_agent Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 93c0e0d4..94a03f95 100644 --- a/Makefile +++ b/Makefile @@ -333,7 +333,7 @@ sample_app_agent: undeploy_sample_app_agent ## Deploy sample app agent. $(CLUSTER_CLIENT) set env $(SAMPLE_APP_FLAGS) deployment/quarkus-test-agent CRYOSTAT_AGENT_AUTHORIZATION="Bearer $(AUTH_TOKEN)" .PHONY: undeploy_sample_app_agent -undeploy_sample_app_agent: ## Undeploy sample app agent. +undeploy_sample_app_agent: ## Undeploy sample app with Cryostat Agent. - $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app-agent.yaml .PHONY: cert_manager From 79530b0f4c0b9a8a991dde76797d223956dbde49 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:27:04 +0300 Subject: [PATCH 10/26] sample_app_agent Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 94a03f95..bbf7e207 100644 --- a/Makefile +++ b/Makefile @@ -320,7 +320,7 @@ undeploy_sample_app: ## Undeploy sample app. $(CLUSTER_CLIENT) delete $(SAMPLE_APP_FLAGS) --ignore-not-found=$(ignore-not-found) -f config/samples/sample-app.yaml .PHONY: sample_app_agent -sample_app_agent: undeploy_sample_app_agent ## Deploy sample app agent. +sample_app_agent: undeploy_sample_app_agent ## Deploy sample app with Cryostat Agent. @if [ -z "${AUTH_TOKEN}" ]; then \ if [ "${CLUSTER_CLIENT}" = "oc" ]; then\ AUTH_TOKEN=`oc whoami -t | base64`; \ From fcb02114057862d8eaa6bb2e7fbb200c159581bd Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:27:19 +0300 Subject: [PATCH 11/26] sample_app Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> From b284bd325fa2b62fcca96acc03cc6c513f50b7d5 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:27:50 +0300 Subject: [PATCH 12/26] check-license Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bbf7e207..85a59797 100644 --- a/Makefile +++ b/Makefile @@ -292,7 +292,7 @@ generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and LICENSE_FILE = $(shell pwd)/LICENSE GO_PACKAGES := $(shell go list -test -f '{{.Dir}}' ./... | sed -e "s|^$$(pwd)||" | cut -d/ -f2 | sort -u) .PHONY: check-license -check-license: golicense ## Check and add (if missing) license header. +check-license: golicense ## Check if license headers are missing from any code files. @echo "Checking license..." $(GOLICENSE) --config=go-license.yml --verify $(shell find ${GO_PACKAGES} -name "*.go") From 8bbb666b82f228dcff05f3857dc99fdd27ab6607 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:34:36 +0300 Subject: [PATCH 13/26] install Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 85a59797..db8a4525 100644 --- a/Makefile +++ b/Makefile @@ -421,7 +421,7 @@ endif ##@ Deployment .PHONY: install -install: manifests kustomize ## Install CRDs into a cluster. +install: manifests kustomize ## Install CRDs into the cluster specified in ~/.kube/config. $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) apply -f - .PHONY: uninstall From bd475033276eb86231ec3cf2a2bdf7ea1808b8e0 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:35:03 +0300 Subject: [PATCH 14/26] uninstall Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index db8a4525..cf65cba1 100644 --- a/Makefile +++ b/Makefile @@ -425,7 +425,7 @@ install: manifests kustomize ## Install CRDs into the cluster specified in ~/.ku $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) apply -f - .PHONY: uninstall -uninstall: manifests kustomize ## Uninstall CRDs from a cluster. +uninstall: manifests kustomize ## Uninstall CRDs from the cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: predeploy From faa0469795e197dc5f7d00234e0355a81a852cae Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:36:58 +0300 Subject: [PATCH 15/26] deploy Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cf65cba1..585281a3 100644 --- a/Makefile +++ b/Makefile @@ -438,7 +438,7 @@ print_deploy_config: predeploy ## Print deployment configuration. $(KUSTOMIZE) build config/default .PHONY: deploy -deploy: check_cert_manager manifests kustomize predeploy ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config +deploy: check_cert_manager manifests kustomize predeploy ## Deploy controller in the configured cluster in ~/.kube/config $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) apply -f - ifeq ($(DISABLE_SERVICE_TLS), true) @echo "Disabling TLS for in-cluster communication between Services" From 1db0137067643e971b0912e5482eec0201a3b067 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:38:20 +0300 Subject: [PATCH 16/26] predeploy Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 585281a3..0fe602d6 100644 --- a/Makefile +++ b/Makefile @@ -429,7 +429,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the cluster specified in ~ - $(KUSTOMIZE) build config/crd | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: predeploy -predeploy: ## Prepare for deployment. +predeploy: cd config/manager && $(KUSTOMIZE) edit set image controller=$(OPERATOR_IMG) cd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE) From a2e29cd2108c15277e11cfd38307dc2400214ac6 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:38:49 +0300 Subject: [PATCH 17/26] undeploy Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0fe602d6..2dc9fb30 100644 --- a/Makefile +++ b/Makefile @@ -446,7 +446,7 @@ ifeq ($(DISABLE_SERVICE_TLS), true) endif .PHONY: undeploy -undeploy: ## Undeploy controller from the configured Kubernetes cluster in ~/.kube/config +undeploy: ## Undeploy controller from the configured cluster in ~/.kube/config. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml - $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - From 69438c70c68f5f4d0fddb2ecf402d06b94820551 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:39:34 +0300 Subject: [PATCH 18/26] print_deploy_config Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2dc9fb30..dabbef94 100644 --- a/Makefile +++ b/Makefile @@ -434,7 +434,7 @@ predeploy: cd config/default && $(KUSTOMIZE) edit set namespace $(DEPLOY_NAMESPACE) .PHONY: print_deploy_config -print_deploy_config: predeploy ## Print deployment configuration. +print_deploy_config: predeploy ## Print deployment configurations for the controller. $(KUSTOMIZE) build config/default .PHONY: deploy From 581eaac34d3c8e9b0f0ac2b403145674ea4a62b3 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:40:18 +0300 Subject: [PATCH 19/26] deploy_bundle Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dabbef94..13004d17 100644 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ undeploy: ## Undeploy controller from the configured cluster in ~/.kube/config. - $(KUSTOMIZE) build config/default | $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: deploy_bundle -deploy_bundle: check_cert_manager undeploy_bundle ## Deploy the bundled image. +deploy_bundle: check_cert_manager undeploy_bundle ## Deploy the controller in the bundle format with OLM. $(OPERATOR_SDK) run bundle --install-mode $(BUNDLE_INSTALL_MODE) $(BUNDLE_IMG) ifeq ($(DISABLE_SERVICE_TLS), true) @echo "Disabling TLS for in-cluster communication between Services" From bf6af4dfd135e4093730078d924e22163764a072 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:42:36 +0300 Subject: [PATCH 20/26] undeploy_bundle Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13004d17..0807e3c2 100644 --- a/Makefile +++ b/Makefile @@ -470,7 +470,7 @@ ifeq ($(DISABLE_SERVICE_TLS), true) endif .PHONY: undeploy_bundle -undeploy_bundle: operator-sdk ## Undeploy deployed bundle. +undeploy_bundle: operator-sdk ## Undeploy the controller in the bundle format with OLM. - $(OPERATOR_SDK) cleanup $(OPERATOR_NAME) .PHONY: create_cryostat_cr From f2e31bd15845540eff818ec85bb105dbc6618e80 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:42:46 +0300 Subject: [PATCH 21/26] create_cryostat_cr Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0807e3c2..c9eba23c 100644 --- a/Makefile +++ b/Makefile @@ -474,7 +474,7 @@ undeploy_bundle: operator-sdk ## Undeploy the controller in the bundle format wi - $(OPERATOR_SDK) cleanup $(OPERATOR_NAME) .PHONY: create_cryostat_cr -create_cryostat_cr: destroy_cryostat_cr ## Deploy a Cryostat instance. +create_cryostat_cr: destroy_cryostat_cr ## Create a namespaced Cryostat instance. $(CLUSTER_CLIENT) create -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: create_clustercryostat_cr From 29c52cb3cfa77d6d694ae1e6b167a8d93a3b6bd9 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:44:21 +0300 Subject: [PATCH 22/26] destroy_cryostat_cr Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c9eba23c..8db9e790 100644 --- a/Makefile +++ b/Makefile @@ -485,7 +485,7 @@ create_clustercryostat_cr: destroy_clustercryostat_cr ## Deploy a Cryostat clust oc apply -f - .PHONY: destroy_cryostat_cr -destroy_cryostat_cr: ## Undeploy a Cryostat instance. +destroy_cryostat_cr: ## Delete a namespaced Cryostat instance. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: destroy_clustercryostat_cr From 5f9d5bcb0e7e7d5ce1294e25ef2624e329e95eb7 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:44:31 +0300 Subject: [PATCH 23/26] destroy_clustercryostat_cr Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8db9e790..881aa454 100644 --- a/Makefile +++ b/Makefile @@ -489,5 +489,5 @@ destroy_cryostat_cr: ## Delete a namespaced Cryostat instance. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: destroy_clustercryostat_cr -destroy_clustercryostat_cr: ## Undeploy a Cryostat cluster. +destroy_clustercryostat_cr: ## Delete a cluster-wide Cryostat cluster. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml From 001a0c05281c31e806aa1ee3eeb050115978d3ad Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:45:17 +0300 Subject: [PATCH 24/26] create_clustercryostat_cr Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 881aa454..102f7115 100644 --- a/Makefile +++ b/Makefile @@ -478,7 +478,7 @@ create_cryostat_cr: destroy_cryostat_cr ## Create a namespaced Cryostat instance $(CLUSTER_CLIENT) create -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: create_clustercryostat_cr -create_clustercryostat_cr: destroy_clustercryostat_cr ## Deploy a Cryostat cluster. +create_clustercryostat_cr: destroy_clustercryostat_cr ## Create a cluster-wide Cryostat instance. target_ns_json=$$(jq -nc '$$ARGS.positional' --args -- $(TARGET_NAMESPACES)) && \ $(CLUSTER_CLIENT) patch -f config/samples/operator_v1beta1_clustercryostat.yaml --local=true --type=merge \ -p "{\"spec\": {\"installNamespace\": \"$(DEPLOY_NAMESPACE)\", \"targetNamespaces\": $$target_ns_json}}" -o yaml | \ From afa27fbc86d6f4aa22e44491708deeb744508c14 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:58:44 +0300 Subject: [PATCH 25/26] help Co-authored-by: Thuan Vo Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 102f7115..09c9543d 100644 --- a/Makefile +++ b/Makefile @@ -127,7 +127,7 @@ all: manager .PHONY: help help: ## Display this help. - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-30s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) ##@ Tests From edbc1291b6d1e82bea5b8d719dac0a49d6baef33 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:41:01 +0300 Subject: [PATCH 26/26] destroy_clustercryostat_cr Co-authored-by: Andrew Azores Signed-off-by: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 09c9543d..fed8a53d 100644 --- a/Makefile +++ b/Makefile @@ -489,5 +489,5 @@ destroy_cryostat_cr: ## Delete a namespaced Cryostat instance. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_cryostat.yaml .PHONY: destroy_clustercryostat_cr -destroy_clustercryostat_cr: ## Delete a cluster-wide Cryostat cluster. +destroy_clustercryostat_cr: ## Delete a cluster-wide Cryostat instance. - $(CLUSTER_CLIENT) delete --ignore-not-found=$(ignore-not-found) -f config/samples/operator_v1beta1_clustercryostat.yaml