Skip to content

Commit 85fae74

Browse files
committed
Ignore the registry config if the provided config path is not valid to read
1 parent 75740e5 commit 85fae74

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

charon/config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, data: Dict):
3535
self.__client_key: str = data.get("client_key", None)
3636
self.__client_key_pass_file: str = data.get("client_key_pass_file", None)
3737
self.__root_ca: str = data.get("root_ca", "/etc/pki/tls/certs/ca-bundle.crt")
38-
self.__quay_radas_registry_config: str = data.get("quay_radas_registry_config", None)
38+
self.__quay_radas_registry_config: Optional[str] = data.get("quay_radas_registry_config", None)
3939
self.__radas_sign_timeout_retry_count: int = data.get("radas_sign_timeout_retry_count", 10)
4040
self.__radas_sign_timeout_retry_interval: int = data.get(
4141
"radas_sign_timeout_retry_interval", 60
@@ -66,8 +66,10 @@ def validate(self) -> bool:
6666
if self.__quay_radas_registry_config and not os.access(
6767
self.__quay_radas_registry_config, os.R_OK
6868
):
69-
logger.error("The quay registry config for oras is not valid!")
70-
return False
69+
self.__quay_radas_registry_config = None
70+
logger.warning(
71+
"The quay registry config for oras is not valid, will ignore the registry config!"
72+
)
7173
return True
7274

7375
def umb_target(self) -> str:
@@ -97,7 +99,7 @@ def client_key_password(self) -> str:
9799
def root_ca(self) -> str:
98100
return self.__root_ca
99101

100-
def quay_radas_registry_config(self) -> str:
102+
def quay_radas_registry_config(self) -> Optional[str]:
101103
return self.__quay_radas_registry_config
102104

103105
def radas_sign_timeout_retry_count(self) -> int:

0 commit comments

Comments
 (0)