Taragolis commented on code in PR #23560:
URL: https://github.com/apache/airflow/pull/23560#discussion_r913113058
##########
airflow/configuration.py:
##########
@@ -1487,47 +1500,118 @@ def set(*args, **kwargs) -> None:
conf.set(*args, **kwargs)
-def ensure_secrets_loaded() -> List[BaseSecretsBackend]:
- """
- Ensure that all secrets backends are loaded.
- If the secrets_backend_list contains only 2 default backends, reload it.
- """
- # Check if the secrets_backend_list contains only 2 default backends
- if len(secrets_backend_list) == 2:
- return initialize_secrets_backends()
- return secrets_backend_list
+class DefaultSecretsBackend(UserList):
Review Comment:
Unfortunately not enough in this PR implementation (just what we have right
now). It is fine for current implementation which assume that if length of
backends list is `2` than backends not initialised
https://github.com/apache/airflow/blob/e2fd41f7b14adef2c3a88dde14d088b5ef93b460/airflow/configuration.py#L1499
Might be better (just an idea) create separate class for initialise secrets
backends which care about initialise backends itself and some additional
methods inside this class, like this
https://github.com/apache/airflow/blob/e2fd41f7b14adef2c3a88dde14d088b5ef93b460/airflow/configuration.py#L114-L127
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]