-
Notifications
You must be signed in to change notification settings - Fork 445
fix: fixes CI tests ptn/deployment-script/import-image-to-acr
#4973
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
base: main
Are you sure you want to change the base?
Conversation
…eHezser/bicep-registry-modules into fix-import-image-to-acr-test
…eHezser/bicep-registry-modules into fix-import-image-to-acr-test
@@ -28,14 +28,14 @@ module dependencies 'dependencies.bicep' = { | |||
name: 'dependencies' | |||
scope: resourceGroup | |||
params: { | |||
acrName: 'dep${namePrefix}acr${serviceShort}' | |||
acrName: uniqueString('dep${namePrefix}acr${serviceShort}', subscription().subscriptionId, resourceGroupName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we not agree this is a bad call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some for all other uniqueString
usages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't want to use tags. The likeliness of our "manually" generated names to be not unique is higher than this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think that was a conversation in a call I wasn't able to join. Pardon
We absolutely should not use tags. We did in the very beginning of AVM's predecessor's CARML's predecessor IaCS and has many issues one may not think off when approaching it. E.g., that they're not supported by all resources, nor propagated immediately.
The 'manually' generated names are fine as the namePrefix
is unique to your fork and the serviceShort
unique to each test case. Plus it can be consistently applied to all scopes. Using e.g. the subscription()
function does not work for any scope above. Same for resource group etc. The other problem is that it becomes impossible to trace the name back to its origin.
If you have a conflict, there are several other subjectively better options (which may be objectively wrong 😄)
- Change the
namePrefix
- Add a number suffix to the resource name
- Use the
uniqueString()
, but only for a suffix including atake()
function to ensure the name is not getting too long
I'd probably argue the 3rd option is probably the best and could be rolled out to each test. Using e.g. uniqueString(subscription().subscriptionId)
would ensure the name is always unique to each user and the entire namePrefix
would not be needed. For mgmtGroup we could I guess use it's ID. Something like that. Thoughts?
cc: @eriqua (as you may be interested too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of updating all test cases for an issue which seems to be very limited. We have multiple name chunks decreasing the likelihood of name conflicts, plus not all resources have a globally unique name.
As mentioned in our call I'd suggest the number suffix as the easiest approach. Option 3 Alex suggested is also fine, but I'd suggest to keep it to the owner to change if needed and only for globally unique resource names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is anything still happening here?
Description
The names for Azure resources in the test cases are now calculated and should not generate "name in use" exceptions.
For the max test to pass, we are waiting for Resources in nested template not shown if reference is used in the parameter values
Closes #4943
Closes #4918
Pipeline Reference
Type of Change
version.json
:version.json
.version.json
.Checklist
Set-AVMModule
locally to generate the supporting module files.