From 172f81aae393f4bdda3644459035752f07301100 Mon Sep 17 00:00:00 2001 From: Jason Greathouse Date: Mon, 14 Nov 2022 19:12:20 -0600 Subject: [PATCH] exit gracefully if the namespace already exists (#20) --- entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 43a94e1..f801991 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -392,7 +392,13 @@ then echo "-- Create namespace ${INPUT_NAMESPACE}" # Don't sweat it if the namespace already exists. - k create ns "${INPUT_NAMESPACE}" || echo "Namespace already exists" + if k create ns "${INPUT_NAMESPACE}" + then + echo "Namespace created" + else + echo "Namespace already exists" + exit 0 + fi auth_header="Authorization: Bearer ${INPUT_RANCHER_TOKEN}"