Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
TemplateManagerImpl.validateDetails()only checked whether a template is deploy-as-is when theUEFIkey was present. For any other key it returned early, so settings such asrootDiskControllercould still be added to a deploy-as-is template ("Read Instance settings from OVA"), even though those settings are read directly from the OVA.This moves the deploy-as-is check ahead of the early return. For a deploy-as-is template, any detail whose key is missing from the template's current details, or whose value differs, is rejected with
InvalidParameterValueException("Deploy-as-is Template ... can not have the setting. Settings are read directly from the Template"). Details that are identical to what the template already has are accepted, so clients that re-send the existing settings keep working.Policy choice: the issue discussion asks that no new template settings be allowed for such templates, so all changed or new keys are rejected. The alternative is to reuse the VM-side allow list (
vmware.allowed.additional.details.from.ovainUserVmManagerImpl), but that list is a zone-scoped setting and templates can be shared across zones, so I kept the template check strict. Happy to switch if reviewers prefer the allow list.Targets
4.20because this is a bug fix (milestone 4.20.4, see CONTRIBUTING).Fixes: #12458
Types of changes
How Has This Been Tested?
Unit tests in
TemplateManagerImplTest(new): a deploy-as-is template rejects a new non-UEFI key (failed before the change, passes after), accepts an unchanged key, and a regular template still accepts non-UEFI keys.Checkstyle reports 0 violations. I did not test against a real VMware deploy-as-is template.