From c27cf37a77981f9d7c2d6310179c702fe994b741 Mon Sep 17 00:00:00 2001 From: Kamal Mohammed Date: Thu, 27 Jun 2024 13:56:29 -0600 Subject: [PATCH] GRAD2-2841 - Institute - Update Redis cluster and related IaC to be password protected --- .github/workflows/create-redis-cluster-DEV.yml | 2 +- .github/workflows/create-redis-cluster-PROD.yml | 2 +- .github/workflows/create-redis-cluster-TEST.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create-redis-cluster-DEV.yml b/.github/workflows/create-redis-cluster-DEV.yml index 85841a2..764d15d 100644 --- a/.github/workflows/create-redis-cluster-DEV.yml +++ b/.github/workflows/create-redis-cluster-DEV.yml @@ -40,7 +40,7 @@ jobs: - name: Create Cluster run: | echo "Retrieve redis password..." - REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's/.*"REDIS_PASSWORD": "\(.*\)",/\1/p' | base64 --decode) + REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's|.*"REDIS_PASSWORD": "\([^"]*\)".*|\1|p' | base64 --decode) echo "Creating Cluster..." oc exec -i redis-ha-0 -- redis-cli --cluster create --cluster-replicas 1 $(oc get pods -l app=redis-ha -o jsonpath='{range.items[*]}{.status.podIP}:6379 {end}') --cluster-yes -a $REDIS_PASSWORD echo "Success!" \ No newline at end of file diff --git a/.github/workflows/create-redis-cluster-PROD.yml b/.github/workflows/create-redis-cluster-PROD.yml index d644131..510a7e5 100644 --- a/.github/workflows/create-redis-cluster-PROD.yml +++ b/.github/workflows/create-redis-cluster-PROD.yml @@ -40,7 +40,7 @@ jobs: - name: Create Cluster run: | echo "Retrieve redis password..." - REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's/.*"REDIS_PASSWORD": "\(.*\)",/\1/p' | base64 --decode) + REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's|.*"REDIS_PASSWORD": "\([^"]*\)".*|\1|p' | base64 --decode) echo "Creating Cluster..." oc exec -i redis-ha-0 -- redis-cli --cluster create --cluster-replicas 1 $(oc get pods -l app=redis-ha -o jsonpath='{range.items[*]}{.status.podIP}:6379 {end}') --cluster-yes -a $REDIS_PASSWORD echo "Success!" diff --git a/.github/workflows/create-redis-cluster-TEST.yml b/.github/workflows/create-redis-cluster-TEST.yml index 02c08de..454a09e 100644 --- a/.github/workflows/create-redis-cluster-TEST.yml +++ b/.github/workflows/create-redis-cluster-TEST.yml @@ -40,7 +40,7 @@ jobs: - name: Create Cluster run: | echo "Retrieve redis password..." - REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's/.*"REDIS_PASSWORD": "\(.*\)",/\1/p' | base64 --decode) + REDIS_PASSWORD=$(oc -o json get secret redis-ha | sed -n 's|.*"REDIS_PASSWORD": "\([^"]*\)".*|\1|p' | base64 --decode) echo "Creating Cluster..." oc exec -i redis-ha-0 -- redis-cli --cluster create --cluster-replicas 1 $(oc get pods -l app=redis-ha -o jsonpath='{range.items[*]}{.status.podIP}:6379 {end}') --cluster-yes -a $REDIS_PASSWORD echo "Success!"