-
Notifications
You must be signed in to change notification settings - Fork 194
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
CreateUiDefinition - NestedTemplates - Outputs Must Be Present In Template Parameters - Requires un-needed parameters #492
Comments
👍 looks like we need to track if we're testing a nested template or not. |
It looks like the current PR #535 touches on the same case. If a test has parameters that indicate it was a maintemplateobject, those parameters should be cleared. If any of them were required, the test should be skipped (quietly). e.g. if there was a test requring MainTemplateObject, it should not run when evaulating inner templates of the mainTemplateObject. Skipping of tests can be indicated with Write-Verbose, but would be too noisy otherwise. |
We should back out some of the changes to $TemplateObject if #535 is merged, once a fix for this bug is available. |
I have noticed with the latest version (2021.11.05) it thinks secure @secure()
@description('Specifies the SSH RSA public key string for the Linux nodes.')
param aksClusterSshPublicKey string .. results in ..
.. but obviously putting a default value in a secure valueis not allowed. For clarification: The param in this case does not have its value filled by the UI but by a separate template that runs as part of the deployment It should probably skip this check for secure params like it does in other parts. I can raise a separete bug for this if you think its necessary. Thanks for all your work with this :) |
@stephenpope - can you go ahead and open a new bug for your new case? |
* Test-AzTemplate: Adding support for IsInnerTemplate. Scaffolding for #492. * Outputs-Must-Be-Present-In-Template-Parameters: Adding [switch]$IsInnerTemplate and refactoring conditions under which the test are skipped. * Resolve-JSONContent: Allowing a property index (helps #495) * Expand-AzTemplate: Adding InnerTemplates to each file in FolderFiles (helps fix #495) * Test-AzTemplate: Expanding InnerTemplates correctly for each file in a folder (fixes #495) * Adding test case to validate correct expansion of InnerTemplates/TemplateText (validating #495) * Expand-AzTemplate: Slightly Updating Inline Documentation. * Simplifying Unit Tests * Resolve-JSONContent: Allowing a match segment to have both a property and an index * Test/Expand-AzTemplate: Adding InnerTemplatesText, using it to pass inner templates
As there are a few files involved i have created a Gist to help out -> https://gist.github.com/stephenpope/790a88595efa698e70cd73c31e476084
Setup
I have a simple bicep structure a
main
file with twomodules
(that create nested templates) ..these can be built into a
azuredeploy.json
withbicep build main.bicep --output azuredeploy.json
There is also
createUiDefinition.json
.. this has two textboxes which haveoutputs
defined asoneParameter
+twoParameter
to match the inputparams
of theazuredeploy
script.Error
The script shows errors even though
oneParameter
andtwoParameter
are defined in themain.bicep
file (and appear in the mainparameters
section in thejson
).Discussion
These parameters are not defined in the nested modules because they are not needed. The nested modules have their own parameters.
This seems like an error in working out the constraints (unless I am mistaken :)
The text was updated successfully, but these errors were encountered: