fix: namespace name validation

This commit is contained in:
ange 2024-11-29 04:50:52 +00:00
parent 860ab947e4
commit c92462e209
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -6,7 +6,7 @@ set -a
set +a
REGISTRY="${IMAGEAPP%%/*}"
export K8S_NS; K8S_NS="$(tr '[:upper:]' '[:lower:]' <<< "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr -c '[:lower:]-' -)"
export K8S_NS; K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - | sed 's/-\+/-/g; s/^-\+//; s/-$//')"
mkdir -p "$HOME/.kube/"
echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"