From 7c34544e144ef032b9eac8bf451b19b38b0739a0 Mon Sep 17 00:00:00 2001 From: John Pitman Date: Thu, 7 Nov 2024 14:44:08 -0500 Subject: [PATCH] generate server.secretkey for the agents Signed-off-by: John Pitman --- .github/workflows/ci.yaml | 1 + test/e2e2/test-env/setup-vcluster-env.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2c6e2f2..a678263 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,7 @@ on: push: branches: - 'main' + - 'gitops-5159-e2e-test-framework' pull_request: branches: - 'main' 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