Merge pull request #10022 from ninjadq/fix_ca_bundle_path_join

Fix ca bundle path join issue
This commit is contained in:
Qian Deng 2019-12-02 11:31:23 +08:00 committed by GitHub
commit e5f8c2d779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,10 @@ def validate(conf: dict, **kwargs):
# ca_bundle validate
if conf.get('registry_custom_ca_bundle_path'):
registry_custom_ca_bundle_path = conf.get('registry_custom_ca_bundle_path') or ''
ca_bundle_host_path = os.path.join(host_root_dir, registry_custom_ca_bundle_path)
if registry_custom_ca_bundle_path.startswith('/data/'):
ca_bundle_host_path = registry_custom_ca_bundle_path
else:
ca_bundle_host_path = os.path.join(host_root_dir, registry_custom_ca_bundle_path.lstrip('/'))
try:
uid = os.stat(ca_bundle_host_path).st_uid
st_mode = os.stat(ca_bundle_host_path).st_mode