outposts: fix defaults and tests for outposts

This commit is contained in:
Jens Langhammer
2020-11-04 10:54:44 +01:00
parent 706448dc14
commit 3b76af4eaa
14 changed files with 136 additions and 61 deletions

View File

@ -20,8 +20,9 @@ class BaseController:
outpost: Outpost
connection: OutpostServiceConnection
def __init__(self, outpost: Outpost):
def __init__(self, outpost: Outpost, connection: OutpostServiceConnection):
self.outpost = outpost
self.connection = connection
self.logger = get_logger()
self.deployment_ports = {}

View File

@ -23,8 +23,8 @@ class DockerController(BaseController):
image_base = "beryju/passbook"
def __init__(self, outpost: Outpost) -> None:
super().__init__(outpost)
def __init__(self, outpost: Outpost, connection: DockerServiceConnection) -> None:
super().__init__(outpost, connection)
try:
if self.connection.local:
self.client = DockerClient.from_env()

View File

@ -25,8 +25,10 @@ class KubernetesController(BaseController):
connection: KubernetesServiceConnection
def __init__(self, outpost: Outpost) -> None:
super().__init__(outpost)
def __init__(
self, outpost: Outpost, connection: KubernetesServiceConnection
) -> None:
super().__init__(outpost, connection)
try:
if self.connection.local:
load_incluster_config()