outposts: fix defaults and tests for outposts
This commit is contained in:
		| @ -6,7 +6,7 @@ import yaml | ||||
| from django.test import TestCase | ||||
|  | ||||
| from passbook.flows.models import Flow | ||||
| from passbook.outposts.models import Outpost, OutpostDeploymentType, OutpostType | ||||
| from passbook.outposts.models import KubernetesServiceConnection, Outpost, OutpostType | ||||
| from passbook.providers.proxy.controllers.kubernetes import ProxyKubernetesController | ||||
| from passbook.providers.proxy.models import ProxyProvider | ||||
|  | ||||
| @ -23,15 +23,16 @@ class TestControllers(TestCase): | ||||
|             external_host="http://localhost", | ||||
|             authorization_flow=Flow.objects.first(), | ||||
|         ) | ||||
|         service_connection = KubernetesServiceConnection.objects.get(local=True) | ||||
|         outpost: Outpost = Outpost.objects.create( | ||||
|             name="test", | ||||
|             type=OutpostType.PROXY, | ||||
|             deployment_type=OutpostDeploymentType.KUBERNETES, | ||||
|             service_connection=service_connection, | ||||
|         ) | ||||
|         outpost.providers.add(provider) | ||||
|         outpost.save() | ||||
|  | ||||
|         controller = ProxyKubernetesController(outpost) | ||||
|         controller = ProxyKubernetesController(outpost, service_connection) | ||||
|         manifest = controller.get_static_deployment() | ||||
|         self.assertEqual(len(list(yaml.load_all(manifest, Loader=yaml.SafeLoader))), 4) | ||||
|  | ||||
| @ -43,14 +44,15 @@ class TestControllers(TestCase): | ||||
|             external_host="http://localhost", | ||||
|             authorization_flow=Flow.objects.first(), | ||||
|         ) | ||||
|         service_connection = KubernetesServiceConnection.objects.get(local=True) | ||||
|         outpost: Outpost = Outpost.objects.create( | ||||
|             name="test", | ||||
|             type=OutpostType.PROXY, | ||||
|             deployment_type=OutpostDeploymentType.KUBERNETES, | ||||
|             service_connection=service_connection, | ||||
|         ) | ||||
|         outpost.providers.add(provider) | ||||
|         outpost.save() | ||||
|  | ||||
|         controller = ProxyKubernetesController(outpost) | ||||
|         controller = ProxyKubernetesController(outpost, service_connection) | ||||
|         controller.up() | ||||
|         controller.down() | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer