Skip to content

Commit

Permalink
tmp secret hash
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 15, 2024
1 parent 8a789dd commit 4c34e4a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,24 @@ undeploy_sample_app_agent_proxy: ## Undeploy sample app with Cryostat Agent conf

.PHONY: sample_app_agent_proxy
sample_app_agent_proxy: undeploy_sample_app_agent_proxy ## Deploy sample app with Cryostat Agent configured for TLS client auth on nginx proxy.
$(CLUSTER_CLIENT) apply $(SAMPLE_APP_FLAGS) -f config/samples/sample-app-agent-tls-proxy.yaml
@if [ -z "${SECRET_HASH}" ]; then \
if [ -z "${DEPLOY_NAMESPACE}" ]; then \
if [ "${CLUSTER_CLIENT}" = "oc" ]; then \
DEPLOY_NAMESPACE=`oc project -q`; \
else \
echo "'DEPLOY_NAMESPACE' must be specified."; \
exit 1; \
fi; \
fi; \
if [ -z "${SAMPLE_APP_NAMESPACE}" ]; then \
echo "'SAMPLE_APP_NAMESPACE' must be specified."; \
exit 1; \
fi ;\
SECRET_HASH=`echo -n ${DEPLOY_NAMESPACE}/cryostat-sample/${SAMPLE_APP_NAMESPACE} | sha256sum`; \
fi; \
$(CLUSTER_CLIENT) patch -f config/samples/sample-app-agent-tls-proxy.yaml --local=true --type=merge \
-p "{\"spec\":{\"template\":{\"spec\":{\"\$setElementOrder/volumes\":[{\"name\":\"agent-tls\"}],\"volumes\":[{\"\$retainKeys\":[\"name\",\"secret\"],\"name\":\"agent-tls\",\"secret\":{\"secretName\":\"cryostat-agent-$${SECRET_HASH}\"}}]}}}}" \
-o yaml | oc apply -f -

.PHONY: undeploy_sample_app_agent
undeploy_sample_app_agent: ## Undeploy sample app with Cryostat Agent.
Expand Down
3 changes: 1 addition & 2 deletions config/samples/sample-app-agent-tls-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ spec:
volumes:
- name: agent-tls
secret:
# FIXME determine the secretName at deployment time in the Makefile and patch it here
secretName: cryostat-agent-f46ed1c40de4d61ac533fef337f7705ac39c8690f91a9cdca5185140f0455563
secretName: cryostat-agent-abcd1234
defaultMode: 420
---
apiVersion: v1
Expand Down

0 comments on commit 4c34e4a

Please sign in to comment.