mirror of
https://github.com/goharbor/harbor
synced 2025-04-16 15:18:00 +00:00
update tlsOptions for external redis (#21681)
Signed-off-by: yminer <miner.yang@broadcom.com> Co-authored-by: yminer <miner.yang@broadcom.com>
This commit is contained in:
parent
e40db21681
commit
3b8c18fd26
|
@ -220,7 +220,8 @@ _version: 2.12.0
|
|||
# # mtls for redis connection is not supported
|
||||
# # tls connection will be disable by default
|
||||
# tlsOptions:
|
||||
# # if the tlsOptions.rootCA has been specified, then tls connection will be enabled.
|
||||
# enable: false
|
||||
# # if it is a self-signed ca, please set the ca path specifically.
|
||||
# rootCA:
|
||||
# # db_index 0 is for core, it's unchangeable
|
||||
# registry_db_index: 1
|
||||
|
|
|
@ -356,7 +356,7 @@ def parse_yaml_config(config_file_path, with_trivy):
|
|||
return config_dict
|
||||
|
||||
def get_redis_schema(redis=None):
|
||||
if 'tlsOptions' in redis and redis['tlsOptions'].get('rootCA') is not None:
|
||||
if 'tlsOptions' in redis and redis['tlsOptions'].get('enable'):
|
||||
return redis.get('sentinel_master_set', None) and 'rediss+sentinel' or 'rediss'
|
||||
else:
|
||||
return redis.get('sentinel_master_set', None) and 'redis+sentinel' or 'redis'
|
||||
|
@ -465,7 +465,7 @@ def get_redis_configs(internal_redis=None, external_redis=None, with_trivy=True)
|
|||
if with_trivy:
|
||||
configs['trivy_redis_url'] = get_redis_url(redis['trivy_db_index'], redis)
|
||||
|
||||
if 'tlsOptions' in redis and redis['tlsOptions'].get('rootCA') is not None:
|
||||
if 'tlsOptions' in redis and redis['tlsOptions'].get('enable'):
|
||||
configs['redis_custom_tls_ca_path'] = redis['tlsOptions']['rootCA']
|
||||
|
||||
return configs
|
||||
|
|
Loading…
Reference in New Issue
Block a user