Add the started-in-ci tag to the started instances

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-11-16 03:58:24 +00:00 committed by Megan Wilhite
parent 1c5566d5e9
commit dfa8257969

View file

@ -471,8 +471,15 @@ class VM:
ssh_connection_timeout = self.config.connect_timeout
ssh_connection_timeout_progress = 0
started_in_ci = os.environ.get("RUNNER_NAME") is not None
tags = [
{"Key": "vm-name", "Value": self.name},
{"Key": "instance-client-id", "Value": REPO_CHECKOUT_ID},
{"Key": "started-in-ci", "Value": str(started_in_ci).lower()},
]
network_interfaces = None
if os.environ.get("RUNNER_NAME") is not None:
if started_in_ci:
log.info("Starting CI configured VM")
else:
# This is a developer running
@ -545,11 +552,6 @@ class VM:
f"Starting {self!r} in {self.region_name!r} with ssh key named {key_name!r}...",
total=create_timeout,
)
tags = [
{"Key": "vm-name", "Value": self.name},
{"Key": "instance-client-id", "Value": REPO_CHECKOUT_ID},
]
if os.environ.get("CI") is not None:
job = os.environ["GITHUB_JOB"]
ref = os.environ["GITHUB_REF"]