Skip to content

Commit

Permalink
Skip cert-manager issuer creation when secrets exist (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanEllington authored Dec 14, 2020
1 parent bbb6437 commit dec7d3a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/tls-include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ function create_tls_certs {
context=$2
shift 2
apps=("$@")

# Optional TLS Support
deploy_issuers $namespace $context

# Certs honor USER_DIR for overrides/customizations

deployedIssuers="false"
# Certs honor USER_DIR for overrides/customizations
for app in "${apps[@]}"; do
# Only create the secrets if they do not exist
TLS_SECRET_NAME=$app-tls-secret
if [ -z "$(kubectl get secret -n $namespace $TLS_SECRET_NAME -o name 2>/dev/null)" ]; then
if [ "$deployedIssuers" == "false"]; then
deploy_issuers $namespace $context
deployedIssuers="true"
fi
deploy_app_cert "$namespace" "$context" "$app"
else
log_debug "Using existing $TLS_SECRET_NAME for [$app]"
Expand Down

0 comments on commit dec7d3a

Please sign in to comment.