From 218889acdd815edd8a3680fdaa4778a6fc6b1f2d Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Thu, 9 May 2019 18:57:57 +0800 Subject: [PATCH] Fix issue: https://github.com/goharbor/harbor/issues/7288 Signed-off-by: liqiang-fit2cloud --- make/photon/prepare/utils/chart.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/make/photon/prepare/utils/chart.py b/make/photon/prepare/utils/chart.py index 5e76b8f3c..dd6611b21 100644 --- a/make/photon/prepare/utils/chart.py +++ b/make/photon/prepare/utils/chart.py @@ -77,9 +77,13 @@ def prepare_chartmuseum(config_dict): elif storage_provider_name == 'oss': # aliyun OSS storage_driver = "alibaba" - storage_provider_config_options.append("STORAGE_ALIBABA_BUCKET=%s" % ( storage_provider_config_map.get("bucket") or '') ) + bucket = storage_provider_config_map.get("bucket") or '' + endpoint = storage_provider_config_map.get("endpoint") or '' + if endpoint.startswith(bucket + "."): + endpoint = endpoint.replace(bucket + ".", "") + storage_provider_config_options.append("STORAGE_ALIBABA_BUCKET=%s" % bucket ) + storage_provider_config_options.append("STORAGE_ALIBABA_ENDPOINT=%s" % endpoint ) storage_provider_config_options.append("STORAGE_ALIBABA_PREFIX=%s" % ( storage_provider_config_map.get("rootdirectory") or '') ) - storage_provider_config_options.append("STORAGE_ALIBABA_ENDPOINT=%s" % ( storage_provider_config_map.get("endpoint") or '') ) storage_provider_config_options.append("ALIBABA_CLOUD_ACCESS_KEY_ID=%s" % ( storage_provider_config_map.get("accesskeyid") or '') ) storage_provider_config_options.append("ALIBABA_CLOUD_ACCESS_KEY_SECRET=%s" % ( storage_provider_config_map.get("accesskeysecret") or '') ) else: