From 5bd3dcad73d40cb4ee1d40dd901c155d77a2db32 Mon Sep 17 00:00:00 2001 From: John Pitman Date: Thu, 7 Nov 2024 14:50:49 -0500 Subject: [PATCH] generate server.secretkey for the agents Signed-off-by: John Pitman --- test/e2e2/test-env/setup-vcluster-env.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/e2e2/test-env/setup-vcluster-env.sh b/test/e2e2/test-env/setup-vcluster-env.sh index 3ec18d0..ff175fb 100755 --- a/test/e2e2/test-env/setup-vcluster-env.sh +++ b/test/e2e2/test-env/setup-vcluster-env.sh @@ -105,13 +105,23 @@ apply() { echo "-> TMP_DIR is $TMP_DIR" cp -r ${SCRIPTPATH}/* $TMP_DIR - # Comment out 'loadBalancerIP:' lines on OpenShift + # Comment out 'loadBalancerIP:' lines on OpenShift if [[ "$OPENSHIFT" != "" ]]; then sed -i.bak -e '/loadBalancerIP/s/^/#/' $TMP_DIR/control-plane/redis-service.yaml sed -i.bak -e '/loadBalancerIP/s/^/#/' $TMP_DIR/control-plane/repo-server-service.yaml sed -i.bak -e '/loadBalancerIP/s/^/#/' $TMP_DIR/control-plane/server-service.yaml fi + # Generate the server secret key for the argocd running on the managed and autonomous agent clusters + echo "-> Generate server.secretkey for agent's argocd-secrets" + if ! pwmake=$(which pwmake); then + pwmake=$(which pwgen) + fi + echo "data:" >> $TMP_DIR/agent-managed/argocd-secret.yaml + echo " server.secretkey: $($pwmake 56 | base64)" >> $TMP_DIR/agent-managed/argocd-secret.yaml + echo "data:" >> $TMP_DIR/agent-autonomous/argocd-secret.yaml + echo " server.secretkey: $($pwmake 56 | base64)" >> $TMP_DIR/agent-autonomous/argocd-secret.yaml + echo "-> Create Argo CD on control plane" cluster=control-plane