Skip to content

Commit a1b82cc

Browse files
committed
Merge branch 'deploy-create-pass-cluster' into vaasl-deploy
2 parents bd5b806 + 05c8765 commit a1b82cc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

stack_orchestrator/deploy/deployment_create.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,10 @@ def _copy_files_to_directory(file_paths: List[Path], directory: Path):
422422
copy(path, os.path.join(directory, os.path.basename(path)))
423423

424424

425-
def _create_deployment_file(deployment_dir: Path):
425+
def _create_deployment_file(deployment_dir: Path, cluster):
426426
deployment_file_path = deployment_dir.joinpath(constants.deployment_file_name)
427-
cluster = f"{constants.cluster_name_prefix}{token_hex(8)}"
427+
if cluster is None:
428+
cluster = f"{constants.cluster_name_prefix}{token_hex(8)}"
428429
with open(deployment_file_path, "w") as output_file:
429430
output_file.write(f"{constants.cluster_id_key}: {cluster}\n")
430431

@@ -471,7 +472,7 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, extr
471472
# Copy spec file and the stack file into the deployment dir
472473
copyfile(spec_file, deployment_dir_path.joinpath(constants.spec_file_name))
473474
copyfile(stack_file, deployment_dir_path.joinpath(constants.stack_file_name))
474-
_create_deployment_file(deployment_dir_path)
475+
_create_deployment_file(deployment_dir_path, deployment_command_context.cluster_context.cluster)
475476
# Copy any config varibles from the spec file into an env file suitable for compose
476477
_write_config_file(spec_file, deployment_dir_path.joinpath(constants.config_file_name))
477478
# Copy any k8s config file into the deployment dir

0 commit comments

Comments
 (0)