Fix lint errors

This commit is contained in:
David Boreham 2023-10-20 14:32:12 -06:00
parent f60717fbc3
commit bfc668d64d
3 changed files with 29 additions and 4 deletions

View File

@ -58,7 +58,7 @@ def command(ctx, include, exclude, env_file, cluster):
def create_deploy_context(global_context, stack, include, exclude, cluster, env_file):
cluster_context = _make_cluster_context(global_context, stack, include, exclude, cluster, env_file)
# See: https://gabrieldemarmiesse.github.io/python-on-whales/sub-commands/compose/
deployer = getDeployer(compose_files=cluster_context.compose_files, compose_project_name=cluster_context.cluster,
deployer = getDeployer("docker", compose_files=cluster_context.compose_files, compose_project_name=cluster_context.cluster,
compose_env_file=cluster_context.env_file)
return DeployCommandContext(stack, cluster_context, deployer)

View File

@ -18,5 +18,27 @@ from app.deployer import Deployer
class K8sDeployer(Deployer):
def __init__(self) -> None:
def __init__(self, compose_files, compose_project_name, compose_env_file) -> None:
config.load_kube_config()
self.client = client.CoreV1Api()
def compose_up(self, detach, services):
pass
def compose_down(self, timeout, volumes):
pass
def compose_ps(self):
pass
def compose_port(self, service, private_port):
pass
def compose_execute(self, service_name, command, envs):
pass
def compose_logs(self, services, tail, follow, stream):
pass
def run(self, image, command, user, volumes, entrypoint=None):
pass

View File

@ -17,5 +17,8 @@ from app.deploy_k8s import K8sDeployer
from app.deploy_docker import DockerDeployer
def getDeployer(compose_files, compose_project_name, compose_env_file):
return DockerDeployer(compose_files, compose_project_name, compose_env_file)
def getDeployer(type, compose_files, compose_project_name, compose_env_file):
if type == "docker":
return DockerDeployer(compose_files, compose_project_name, compose_env_file)
else:
return K8sDeployer(compose_files, compose_project_name, compose_env_file)