From 68759ae02adb38187a08dbb9069950576b979edf Mon Sep 17 00:00:00 2001 From: Maor Friedman Date: Tue, 10 Sep 2024 10:15:51 +0300 Subject: [PATCH 1/3] openshift-tekton-resources early-exit --- reconcile/openshift_tekton_resources.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reconcile/openshift_tekton_resources.py b/reconcile/openshift_tekton_resources.py index 9b9f740400..db747c0996 100644 --- a/reconcile/openshift_tekton_resources.py +++ b/reconcile/openshift_tekton_resources.py @@ -464,3 +464,7 @@ def run( sys.exit(ExitCodes.ERROR) sys.exit(0) + + +def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]: + return fetch_tkn_providers() From b677614a5d4cd6c2da87c93da84dc47135162503 Mon Sep 17 00:00:00 2001 From: Maor Friedman Date: Tue, 10 Sep 2024 10:23:21 +0300 Subject: [PATCH 2/3] fix --- reconcile/openshift_tekton_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reconcile/openshift_tekton_resources.py b/reconcile/openshift_tekton_resources.py index db747c0996..0597bbf4ac 100644 --- a/reconcile/openshift_tekton_resources.py +++ b/reconcile/openshift_tekton_resources.py @@ -467,4 +467,4 @@ def run( def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]: - return fetch_tkn_providers() + return fetch_tkn_providers(saas_file_name=None) From 6fad5edf4e5ae746000a74239c0c22b0e023e192 Mon Sep 17 00:00:00 2001 From: Maor Friedman Date: Tue, 10 Sep 2024 12:09:27 +0300 Subject: [PATCH 3/3] sort --- reconcile/openshift_tekton_resources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reconcile/openshift_tekton_resources.py b/reconcile/openshift_tekton_resources.py index 0597bbf4ac..80b6bc1951 100644 --- a/reconcile/openshift_tekton_resources.py +++ b/reconcile/openshift_tekton_resources.py @@ -125,9 +125,12 @@ def fetch_tkn_providers(saas_file_name: str | None) -> dict[str, Any]: tkn_providers[provider_name]["saas_files"].append(sf) + for provider_name in tkn_providers: + tkn_providers[provider_name]["saas_files"].sort(key=lambda sf: sf["name"]) + return { provider_name: sf - for provider_name, sf in tkn_providers.items() + for provider_name, sf in sorted(tkn_providers.items()) if is_in_shard(provider_name) }