From d9646d09ce3f59084e713014d1567a6fc2c70ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 26 Mar 2021 12:45:45 +0100 Subject: [PATCH] ceph: remove extra slash in curl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When no VAULT_BACKEND_PATH is specified we default to the API one which is set to "secret/", we could use a different variable but we don't want to break the library support. Bonus point this will also fix issue with users passing a slash at the end of the path. Signed-off-by: Sébastien Han --- pkg/operator/ceph/cluster/osd/spec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/operator/ceph/cluster/osd/spec.go b/pkg/operator/ceph/cluster/osd/spec.go index d6069b797..3de9979eb 100644 --- a/pkg/operator/ceph/cluster/osd/spec.go +++ b/pkg/operator/ceph/cluster/osd/spec.go @@ -190,6 +190,9 @@ if [ -n "$VAULT_TLS_SERVER_NAME" ]; then ARGS+=(--connect-to ::"${VAULT_TLS_SERVER_NAME}":) fi +# trim VAULT_BACKEND_PATH for last character '/' to avoid a redirect response from the server +VAULT_BACKEND_PATH="${VAULT_BACKEND_PATH%%/}" + # Check KV engine version if [[ "$VAULT_BACKEND" == "v2" ]]; then PYTHON_DATA_PARSE="['data']['data']"