Fix formatting
This commit is contained in:
parent
8e73894cee
commit
17d63b4c9c
@ -47,7 +47,7 @@ class K8sDeployer(Deployer):
|
|||||||
|
|
||||||
def up(self, detach, services):
|
def up(self, detach, services):
|
||||||
# Create the kind cluster
|
# Create the kind cluster
|
||||||
create_cluster(self.kind_cluster_name)
|
create_cluster(self.kind_cluster_name, )
|
||||||
self.connect_api()
|
self.connect_api()
|
||||||
# Ensure the referenced containers are copied into kind
|
# Ensure the referenced containers are copied into kind
|
||||||
load_images_into_kind(self.kind_cluster_name, self.cluster_info.image_set)
|
load_images_into_kind(self.kind_cluster_name, self.cluster_info.image_set)
|
||||||
@ -120,7 +120,7 @@ class K8sDeployerConfigGenerator(DeployerConfigGenerator):
|
|||||||
def generate(self, deployment_dir: Path):
|
def generate(self, deployment_dir: Path):
|
||||||
# Check the file isn't already there
|
# Check the file isn't already there
|
||||||
# Get the config file contents
|
# Get the config file contents
|
||||||
content = generate_kind_config()
|
content = generate_kind_config(deployment_dir)
|
||||||
config_file = deployment_dir.joinpath(self.config_file_name)
|
config_file = deployment_dir.joinpath(self.config_file_name)
|
||||||
# Write the file
|
# Write the file
|
||||||
with open(config_file, "w") as output_file:
|
with open(config_file, "w") as output_file:
|
||||||
|
@ -130,10 +130,10 @@ def _generate_kind_mounts(parsed_pod_files):
|
|||||||
for mount_string in volumes:
|
for mount_string in volumes:
|
||||||
# Looks like: test-data:/data
|
# Looks like: test-data:/data
|
||||||
(volume_name, mount_path) = mount_string.split(":")
|
(volume_name, mount_path) = mount_string.split(":")
|
||||||
volume_definitions.append(f"- hostPath: <where-is-this>\n containerPath:{mount_path}")
|
volume_definitions.append(f" - hostPath: <where-is-this>\n containerPath:{mount_path}")
|
||||||
return (
|
return (
|
||||||
"" if len(volume_definitions) == 0 else (
|
"" if len(volume_definitions) == 0 else (
|
||||||
"extraMounts:\n"
|
" extraMounts:\n"
|
||||||
f"{''.join(volume_definitions)}"
|
f"{''.join(volume_definitions)}"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -152,10 +152,10 @@ def _generate_kind_port_mappings(parsed_pod_files):
|
|||||||
for port_string in ports:
|
for port_string in ports:
|
||||||
# TODO handle the complex cases
|
# TODO handle the complex cases
|
||||||
# Looks like: 80 or something more complicated
|
# Looks like: 80 or something more complicated
|
||||||
port_definitions.append(f"- containerPort: {port_string}\n hostPort:{port_string}")
|
port_definitions.append(f" - containerPort: {port_string}\n hostPort:{port_string}")
|
||||||
return (
|
return (
|
||||||
"" if len(port_definitions) == 0 else (
|
"" if len(port_definitions) == 0 else (
|
||||||
"extraPortMappings:\n"
|
" extraPortMappings:\n"
|
||||||
f"{''.join(port_definitions)}"
|
f"{''.join(port_definitions)}"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -190,7 +190,7 @@ def generate_kind_config(deployment_dir: Path):
|
|||||||
"kind: Cluster\n"
|
"kind: Cluster\n"
|
||||||
"apiVersion: kind.x-k8s.io/v1alpha4\n"
|
"apiVersion: kind.x-k8s.io/v1alpha4\n"
|
||||||
"nodes:\n"
|
"nodes:\n"
|
||||||
" - role: control-plane\n"
|
"- role: control-plane\n"
|
||||||
f"{port_mappings_yml}\n"
|
f"{port_mappings_yml}\n"
|
||||||
f"{mounts_yml}\n"
|
f"{mounts_yml}\n"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user