Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix name collisions on resource groups created by AgentTestSuite #2981

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests_e2e/orchestrator/lib/agent_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,14 @@ def _initialize(self, environment: Environment, variables: Dict[str, Any], lisa_

if isinstance(environment.nodes[0], LocalNode):
# We need to create a new VMSS.
# Use the same naming convention as LISA for the scale set name: lisa-<runbook name>-<run id>-e<rg count>-n0
# Note that we hardcode the scale set name to "n0" since we are creating a single scale set.
# Resource group name cannot have any uppercase characters, because the publicIP cannot have uppercase
# characters in its domain name label.
# Use the same naming convention as LISA for the scale set name: lisa-<runbook name>-<run id>-<rg_name>-n0,
# except that, for the "rg_name", LISA uses "e" as prefix (e.g. "e0", "e1", etc.), while we use "w" (for
# WALinuxAgent, e.g. "w0", "w1", etc.) to avoid name collisions. Also, note that we hardcode the scale set name
# to "n0" since we are creating a single scale set. Lastly, the resource group name cannot have any uppercase
# characters, because the publicIP cannot have uppercase characters in its domain name label.
AgentTestSuite._rg_count_lock.acquire()
try:
self._resource_group_name = f"lisa-{self._runbook_name.lower()}-{RUN_ID}-e{AgentTestSuite._rg_count}"
self._resource_group_name = f"lisa-{self._runbook_name.lower()}-{RUN_ID}-w{AgentTestSuite._rg_count}"
AgentTestSuite._rg_count += 1
finally:
AgentTestSuite._rg_count_lock.release()
Expand Down
Loading