This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Fix validation for firstConsecutiveStaticIP #4209
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this should go in the
validate.go
area, as this validation is only a convenience foracs-engine deploy
CLI usage.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.
This logic was originally in
validate.go
. But as we have seen in e2e tests, what we want to do here is to validate the user-provided apimodel, not the generated apimodel. Since we want to notify the user that we are generating thisfirstConsecutiveStaticIP
for them if they are using custom vnet and VMSS master profile, instead of asking them to provide a value.When we run e2e tests,
cli_provisioner.go
callsengine.ParseOutput
intemplate.go
which callsapiloader.LoadContainerServiceFromFile(path, true, false, nil)
that triggersvalidate.go
on the generated apimodel.acs-engine/test/e2e/runner/cli_provisioner.go
Line 223 in 29ad616
This causes the e2e tests to fail since the generated apimodel now includes the
firstConsecutiveStaticIP
we generated based on the vnetCidr provided by the user.acs-engine/test/e2e/engine/template.go
Lines 283 to 294 in 29ad616
When we run
acs-engine deploy
,validateApimodel
in deploy.go validates the user-provided apimodel beforedc.containerService.SetPropertiesDefaults
is called.acs-engine/cmd/deploy.go
Lines 88 to 91 in 29ad616
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.
Hmm,
vlabs/validate.go
should only validate user input, not the generated data...