Skip to content

Commit

Permalink
Revert "fix: Remove the higress console secret initialization and pre…
Browse files Browse the repository at this point in the history
…check logic (higress-group#47)"

This reverts commit 88e2210.
  • Loading branch information
CH3CHO committed Dec 21, 2023
1 parent 1a42d13 commit 766f14f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions compose/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,20 @@ data:
mode: standalone
EOF
publishConfig "higress-system" "configmaps" "higress-console" "$content"

read -r -d '' content << EOF
apiVersion: v1
data:
iv: $(cat /dev/urandom | tr -dc '[:graph:]' | fold -w 16 | head -n 1 | tr -d '\n' | base64 -w 0)
key: $(cat /dev/urandom | tr -dc '[:graph:]' | fold -w 32 | head -n 1 | tr -d '\n' | base64 -w 0)
kind: Secret
metadata:
creationTimestamp: "$(now)"
name: higress-console
namespace: higress-system
type: Opaque
EOF
publishConfig "higress-system" "secrets" "higress-console" "$content"
}

initializeConfigStorage
Expand Down
5 changes: 5 additions & 0 deletions compose/scripts/precheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ checkConsole() {
echo " The ConfigMap resource of Higress Console doesn't exist."
exit -1
fi
checkConfigExists "higress-system" "secrets" "higress-console"
if [ $? -ne 0 ]; then
echo " The Secret resource of Higress Console doesn't exist."
exit -1
fi
}

checkStorage
Expand Down

0 comments on commit 766f14f

Please sign in to comment.