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

Supporting longer resource suffix names + Supporting substitutions of values from parents #3219

Closed
wants to merge 4 commits into from

Conversation

eladiw
Copy link
Contributor

@eladiw eladiw commented Feb 13, 2023

Resolves #2893

What is being addressed

This PR addresses issue 2893, where the currently selected suffix of resources (4 chars) is not big enough, hence we sometimes get conflicting resource names (and deployments fail).

It achieves the goal by enhancing the already existing properties substitution mechanism so it will be able to fetch properties from the parents as well (for a user resource, it means from the ws and the ws-svc, for a workspace service it means from the workspace).
This mechanism can be used for other purposes in the future...

How is this addressed

  • Updated the substitution mechanism to receive 2 more dictionaries of the 2 parents.
  • by adding a prefix we can select from which parent we want to fetch the values
  • e.g. "{{ parent_workspace.resource.properties.unique_identifier_suffix }}" vs "{{ parent_workspace_service.resource.properties.unique_identifier_suffix }}" vs "{{ resource.properties.unique_identifier_suffix }}" (see screenshot)

image

  • Backwards compatibility: when installing a ws service on a workspace with the 'old'/shorter suffix it will also be with a shorter suffix, same for a user resource on a workspace with the shorter suffix, otherwise things will break
  • Backwards compatibility: when upgrading a resource if it had the shorter name it will remain so, otherwise many Azure resources will get recreated and break.
  • Updated unittests
  • Currently done for the workspace base, guacamole workspace service and a single guacamole user resource templates only.
  • Once approved will be applied to the rest

How was this PR tested

  • Unittests
    Manually with the following scenarios
  • Created a TRE environment without this PR. Created a workspace (4 chars suffix - old one)
    -Registered the new bundles (ws, ws service and user resource)
  • created in the workspace a guacamole resource -> created with 4 chars
  • created in it a user resource -> created with 4 chars
  • Created a new workspace -> created with 6 chars
  • created in it a guacamole resource -> created with 6 chars
  • same for the user resource
  • Verified it works and everything it wired correctly

workspace resource entry:
image

Guacamole resource entry:
image
User resource entry:
image

@github-actions
Copy link

github-actions bot commented Feb 13, 2023

Unit Test Results

560 tests   560 ✔️  13s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit e99dc0e.

♻️ This comment has been updated with latest results.

@eladiw eladiw changed the title Bug/2893 unique ids Supporting longer resource suffix names + Supporting substitutions of values from parents Feb 13, 2023
@eladiw eladiw closed this Feb 14, 2023
@marrobi marrobi deleted the bug/2893_unique_ids branch March 14, 2024 11:20
@marrobi marrobi restored the bug/2893_unique_ids branch March 14, 2024 11:20
@marrobi marrobi deleted the bug/2893_unique_ids branch June 27, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace deploy fails because storage account is not unique
1 participant