Skip to content

api: Fix OVF defVal & ConfigSpec vAppConfig#3904

Merged
akutz merged 1 commit intovmware:mainfrom
akutz:fix/ovf-to-configspec-vappconfig
Nov 20, 2025
Merged

api: Fix OVF defVal & ConfigSpec vAppConfig#3904
akutz merged 1 commit intovmware:mainfrom
akutz:fix/ovf-to-configspec-vappconfig

Conversation

@akutz
Copy link
Copy Markdown
Member

@akutz akutz commented Nov 19, 2025

Description

This patch addresses some bugs in the way OVFs are unmarshalled as well as transformed into ConfigSpec objects. For some reason the original OVF unmarshalling code ignored the fact that properties have a "value" attribute and not just sub-elements. In fact, the latter is not even in the DMTF OVF spec. There was also a bug in how the default value and value were treated as the same, when they are not.

Closes: NA

How Has This Been Tested?

Added unit tests and enhanced existing ones. Just run go test -v -count=1 ./ovf

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

@akutz akutz force-pushed the fix/ovf-to-configspec-vappconfig branch 2 times, most recently from 32592fc to 3b7d4fe Compare November 19, 2025 22:46
This patch addresses some bugs in the way OVFs are unmarshalled as
well as transformed into ConfigSpec objects. For some reason the
original OVF unmarshalling code ignored the fact that properties
have a "value" attribute and not just sub-elements. In fact, the latter
is not even in the DMTF OVF spec. There was also a bug in how the
default value and value were treated as the same, when they are not.

Signed-off-by: akutz <andrew.kutz@broadcom.com>
@akutz akutz force-pushed the fix/ovf-to-configspec-vappconfig branch from 3b7d4fe to 35b20e6 Compare November 19, 2025 22:53
@akutz akutz requested a review from dougm November 20, 2025 00:07
Copy link
Copy Markdown
Contributor

@aruneshpa aruneshpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akutz akutz merged commit 04c0c6e into vmware:main Nov 20, 2025
11 checks passed
akutz added a commit to akutz/govmomi that referenced this pull request Nov 20, 2025
Apparently we have several OVF examples with `ovf:defaultValue` lying
around, and these are incorrect. There is no such attribute in the OVF
schema per http://schemas.dmtf.org/ovf/envelope/1/dsp8023.xsd. Per the
OVF spec:

> The optional attribute ovf:userConfigurable determines whether the
> property value is configurable during the installation phase. If
> ovf:userConfigurable is FALSE or omitted, the ovf:value attribute
> specifies the value to be used for that customization parameter
> during installation. If ovf:userConfigurable is TRUE, the ovf:value
> attribute specifies a default value for that customization parameter,
> which may be changed during installation.

Therefore the previous behavior was correct.

Signed-off-by: akutz <andrew.kutz@broadcom.com>
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.

2 participants