|
34 | 34 | _unresolved_token_pattern = re.compile("(@@(PROP|FILE|ENV|SECRET):)")
|
35 | 35 |
|
36 | 36 | _secret_dirs_variable = "WDT_MODEL_SECRETS_DIRS"
|
37 |
| -_secret_dirs_default = "/weblogic-operator/config-overrides-secrets" |
38 | 37 | _secret_dir_pairs_variable="WDT_MODEL_SECRETS_NAME_DIR_PAIRS"
|
39 | 38 |
|
40 | 39 | _secret_token_map = None
|
@@ -355,17 +354,19 @@ def _init_secret_token_map(model_context):
|
355 | 354 |
|
356 | 355 | # add name/key pairs for files in sub-directories of directories in WDT_MODEL_SECRETS_DIRS.
|
357 | 356 |
|
358 |
| - locations = os.environ.get(_secret_dirs_variable, _secret_dirs_default) |
359 |
| - for dir in locations.split(","): |
360 |
| - if not os.path.isdir(dir): |
361 |
| - # log at WARN or INFO, but no exception is thrown |
362 |
| - log_method('WLSDPLY-01738', _secret_dirs_variable, dir, class_name=_class_name, method_name=method_name) |
363 |
| - continue |
364 |
| - |
365 |
| - for subdir_name in os.listdir(dir): |
366 |
| - subdir_path = os.path.join(dir, subdir_name) |
367 |
| - if os.path.isdir(subdir_path): |
368 |
| - _add_file_secrets_to_map(subdir_path, subdir_name, model_context) |
| 357 | + locations = os.environ.get(_secret_dirs_variable, None) |
| 358 | + if locations is not None: |
| 359 | + for dir in locations.split(","): |
| 360 | + if not os.path.isdir(dir): |
| 361 | + # log at WARN or INFO, but no exception is thrown |
| 362 | + log_method('WLSDPLY-01738', _secret_dirs_variable, dir, class_name=_class_name, |
| 363 | + method_name=method_name) |
| 364 | + continue |
| 365 | + |
| 366 | + for subdir_name in os.listdir(dir): |
| 367 | + subdir_path = os.path.join(dir, subdir_name) |
| 368 | + if os.path.isdir(subdir_path): |
| 369 | + _add_file_secrets_to_map(subdir_path, subdir_name, model_context) |
369 | 370 |
|
370 | 371 | # add name/key pairs for files in directories assigned in WDT_MODEL_SECRETS_NAME_DIR_PAIRS.
|
371 | 372 | # these pairs will override if they were previously added as sub-directory pairs.
|
|
0 commit comments