From d7574474e3a04b46f9991a1e3a5eea2e1c48ec5c Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 6 Mar 2024 15:14:48 -0600 Subject: [PATCH] WIP: auto-discover certificates --- stack_orchestrator/deploy/k8s/deploy_k8s.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index a3855fee..40e2041e 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -169,7 +169,19 @@ class K8sDeployer(Deployer): print("Service created:") print(f"{service_resp}") + def _find_certificate_for_host_name(self, host_name): + def find_matching_certificate(self, host_name): + all_certificates = self.custom_obj_api.get_namespaced_custom_object( + group="cert-manager.io", + version="v1", + namespace=self.k8s_namespace, + plural="certificates" + ) + for cert in all_certificates: + print(cert) + def up(self, detach, services): + self._find_certificate_for_host_name("foo") if not opts.o.dry_run: if self.is_kind(): # Create the kind cluster