Skip to content

Commit

Permalink
Make target namespaces customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaron committed Mar 20, 2023
1 parent c0e13b2 commit f114889
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ CUSTOM_SCORECARD_VERSION ?= 2.3.0-$(shell date -u '+%Y%m%d%H%M%S')
export CUSTOM_SCORECARD_IMG ?= $(IMAGE_TAG_BASE)-scorecard:$(CUSTOM_SCORECARD_VERSION)

DEPLOY_NAMESPACE ?= cryostat-operator-system
TARGET_NAMESPACES ?= $(DEPLOY_NAMESPACE)
SCORECARD_NAMESPACE ?= cryostat-operator-scorecard

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
Expand Down Expand Up @@ -338,7 +339,10 @@ create_cryostat_cr: destroy_cryostat_cr

.PHONY: create_clustercryostat_cr
create_clustercryostat_cr: destroy_clustercryostat_cr
$(CLUSTER_CLIENT) patch -f config/samples/operator_v1beta1_clustercryostat.yaml --local=true --type=merge -p '{"spec": {"installNamespace": "$(DEPLOY_NAMESPACE)", "targetNamespaces": ["$(DEPLOY_NAMESPACE)"]}}' -o yaml | oc apply -f -
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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ kubectl get secret ${CRYOSTAT_NAME}-jmx-auth -o jsonpath='{$.data.CRYOSTAT_RJMX_
- [`operator-sdk`](https://github.com/operator-framework/operator-sdk) v1.22.2
- [`cert-manager`](https://github.com/jetstack/cert-manager) v1.7.1+ (Recommended)
- `podman` or `docker`
- [`jq`](https://stedolan.github.io/jq/) v1.6+
- `ginkgo` (Optional)

## Instructions
Expand Down

0 comments on commit f114889

Please sign in to comment.