diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 857f17166..4c5053918 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -179,13 +179,13 @@ stages: - task: CmdLine@2 inputs: script: | - export PB_TEST_K8S=true sudo pip install -U wheel pipenv pipenv install --dev - task: CmdLine@2 displayName: Run full test suite inputs: script: | + export PB_TEST_K8S=true pipenv run coverage run ./manage.py test passbook -v 3 - task: CmdLine@2 inputs: @@ -221,7 +221,6 @@ stages: - task: CmdLine@2 inputs: script: | - export PB_TEST_K8S=true sudo pip install -U wheel pipenv pipenv install --dev - task: DockerCompose@0 @@ -241,6 +240,7 @@ stages: displayName: Run full test suite inputs: script: | + export PB_TEST_K8S=true pipenv run coverage run ./manage.py test e2e -v 3 --failfast - task: CmdLine@2 condition: always() diff --git a/passbook/outposts/controllers/k8s/deployment.py b/passbook/outposts/controllers/k8s/deployment.py index 3ac1d3535..d1052e361 100644 --- a/passbook/outposts/controllers/k8s/deployment.py +++ b/passbook/outposts/controllers/k8s/deployment.py @@ -69,7 +69,7 @@ class DeploymentReconciler(KubernetesObjectReconciler[V1Deployment]): spec=V1PodSpec( containers=[ V1Container( - name=self.outpost.type, + name=str(self.outpost.type), image=f"{self.image_base}-{self.outpost.type}:{__version__}", ports=container_ports, env=[ diff --git a/passbook/outposts/controllers/kubernetes.py b/passbook/outposts/controllers/kubernetes.py index f80bc289b..c2717876f 100644 --- a/passbook/outposts/controllers/kubernetes.py +++ b/passbook/outposts/controllers/kubernetes.py @@ -56,7 +56,6 @@ class KubernetesController(BaseController): documents = [] for reconcile_key in self.reconcile_order: reconciler = self.reconcilers[reconcile_key](self) - reconciler.up() documents.append(reconciler.get_reference_object().to_dict()) with StringIO() as _str: diff --git a/passbook/providers/proxy/controllers/k8s/ingress.py b/passbook/providers/proxy/controllers/k8s/ingress.py index 78d10a1e2..90ed9be08 100644 --- a/passbook/providers/proxy/controllers/k8s/ingress.py +++ b/passbook/providers/proxy/controllers/k8s/ingress.py @@ -56,7 +56,10 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]): have_hosts = [rule.host for rule in reference.spec.rules] have_hosts.sort() - have_hosts_tls = reference.spec.tls.hosts + have_hosts_tls = [] + for tls_config in reference.spec.tls: + if tls_config: + have_hosts_tls += tls_config.hosts have_hosts_tls.sort() if have_hosts != expected_hosts: @@ -102,7 +105,7 @@ class IngressReconciler(KubernetesObjectReconciler[NetworkingV1beta1Ingress]): ) return NetworkingV1beta1Ingress( metadata=meta, - spec=NetworkingV1beta1IngressSpec(rules=rules, tls=tls_config), + spec=NetworkingV1beta1IngressSpec(rules=rules, tls=[tls_config]), ) def create(self, reference: NetworkingV1beta1Ingress): diff --git a/passbook/providers/proxy/tests.py b/passbook/providers/proxy/tests.py index a9ce5dd45..a4413f6d5 100644 --- a/passbook/providers/proxy/tests.py +++ b/passbook/providers/proxy/tests.py @@ -31,9 +31,9 @@ class TestControllers(TestCase): outpost.providers.add(provider) outpost.save() - controller = ProxyKubernetesController(outpost.pk) + controller = ProxyKubernetesController(outpost) manifest = controller.get_static_deployment() - self.assertEqual(len(list(yaml.load_all(manifest, Loader=yaml.SafeLoader))), 3) + self.assertEqual(len(list(yaml.load_all(manifest, Loader=yaml.SafeLoader))), 4) def test_kubernetes_controller_deploy(self): """Test Kubernetes Controller""" @@ -51,5 +51,6 @@ class TestControllers(TestCase): outpost.providers.add(provider) outpost.save() - controller = ProxyKubernetesController(outpost.pk) + controller = ProxyKubernetesController(outpost) controller.up() + controller.down()