diff --git a/apache/lib/common b/apache/lib/common index 8cdef50c..2b5779ef 100644 --- a/apache/lib/common +++ b/apache/lib/common @@ -216,9 +216,11 @@ ssl_plugin_cert-provider_prepare() { options=$(yaml_key_val_str "options" "$cfg") || return 1 service_config=$(yaml_key_val_str "$service" "$options") - compose --debug --add-compose-content "$service_config" run --service-ports "$service" \ - crt create "$DOMAIN" $(echo "$SERVER_ALIAS" | shyaml -y get-values 2>/dev/null) || return 1 - + compose --debug --add-compose-content "$service_config" run --rm --service-ports "$service" \ + crt create "$DOMAIN" $(echo "$SERVER_ALIAS" | shyaml -y get-values 2>/dev/null) || { + err "Failed to launch letsencrypt for certificate creation." + return 1 + } config-add "\ services: $MASTER_TARGET_SERVICE_NAME: diff --git a/apache/test/vhost_cert_provider b/apache/test/vhost_cert_provider index 33cc3fa7..77f1bfdb 100644 --- a/apache/test/vhost_cert_provider +++ b/apache/test/vhost_cert_provider @@ -137,7 +137,7 @@ ssl: RELATIONS=(cert-provider foo a True) apache_vhost_create" "known cert key" noerror -is out reg 'Calling: compose .*foo: options: .*run --service-ports foo.*' +is out reg 'Calling: compose .*foo: options: .*run --rm --service-ports foo.*' is out part 'config-add | services: | $MASTER_TARGET_SERVICE_NAME: