mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Fix log level issue in registry
1. fix level issue in registry.jinja 2. add log level to registryctl Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
parent
0a38ae1843
commit
19e8527cc1
@ -1,6 +1,6 @@
|
||||
version: 0.1
|
||||
log:
|
||||
level: {{log_level}}
|
||||
level: {{level}}
|
||||
fields:
|
||||
service: registry
|
||||
storage:
|
||||
|
@ -11,5 +11,5 @@ https_config:
|
||||
protocol: "http"
|
||||
port: 8080
|
||||
{% endif %}
|
||||
log_level: "INFO"
|
||||
log_level: {{level}}
|
||||
registry_config: "/etc/registry/config.yml"
|
||||
|
@ -20,7 +20,6 @@ levels_map = {
|
||||
'fatal': 'fatal'
|
||||
}
|
||||
|
||||
|
||||
def prepare_registry(config_dict):
|
||||
prepare_dir(registry_data_dir, uid=DEFAULT_UID, gid=DEFAULT_GID)
|
||||
prepare_dir(registry_config_dir)
|
||||
@ -42,7 +41,6 @@ def prepare_registry(config_dict):
|
||||
storage_provider_info=storage_provider_info,
|
||||
**config_dict, **redis_ops)
|
||||
|
||||
|
||||
def parse_redis(redis_url):
|
||||
u = urlsplit(redis_url)
|
||||
if not u.scheme or u.scheme == 'redis':
|
||||
@ -81,7 +79,6 @@ def get_storage_provider_info(provider_name, provider_config):
|
||||
storage_provider_info = ('\n' + ' ' * 4).join(storage_provider_conf_list)
|
||||
return storage_provider_info
|
||||
|
||||
|
||||
def gen_passwd_file(config_dict):
|
||||
return subprocess.call(["/usr/bin/htpasswd", "-bcB", registry_passwd_path, config_dict['registry_username'],
|
||||
config_dict['registry_password']], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
||||
|
@ -10,6 +10,14 @@ registryctl_conf = os.path.join(config_dir, "registryctl", "config.yml")
|
||||
registryctl_env_template_path = os.path.join(templates_dir, "registryctl", "env.jinja")
|
||||
registryctl_conf_env = os.path.join(config_dir, "registryctl", "env")
|
||||
|
||||
levels_map = {
|
||||
'debug': 'debug',
|
||||
'info': 'info',
|
||||
'warning': 'warn',
|
||||
'error': 'error',
|
||||
'fatal': 'fatal'
|
||||
}
|
||||
|
||||
def prepare_registry_ctl(config_dict):
|
||||
# prepare dir
|
||||
prepare_dir(registryctl_config_dir)
|
||||
@ -26,4 +34,5 @@ def prepare_registry_ctl(config_dict):
|
||||
registryctl_conf,
|
||||
uid=DEFAULT_UID,
|
||||
gid=DEFAULT_GID,
|
||||
level=levels_map[config_dict['log_level']],
|
||||
**config_dict)
|
||||
|
Loading…
Reference in New Issue
Block a user