Skip to content
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

stages: Add new stage parameter to org.osbuild.ovf #1751

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

elkoniu
Copy link
Contributor

@elkoniu elkoniu commented Apr 23, 2024

osType used in this stage has hardcoded osType value in the template. This commit allows to overwrite this value if needed.

Comment on lines +22 to +25
"ostype": {
"description": "The kind of installed guest operating system",
"type": "string",
"default": "other26xLinux64Guest"
Copy link
Member

Choose a reason for hiding this comment

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

How long is the list of valid values here? Does it make sense to make it an enum to verify that only valid values are used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the list I found it may be quite long: https://docs.vmware.com/en/VMware-HCX/4.9/hcx-user-guide/GUID-D4FFCBD6-9FEC-44E5-9E26-1BD0A2A81389.html
Also we would need to track this list in case something will change.
This whole PR is related to QA request where they would like to be able to "eventually" overwrite default value so I guess in the normal circumstances this wount be used that frequent:)

stages/org.osbuild.ovf Outdated Show resolved Hide resolved
osType used in this stage has hardcoded osType value in the template.
This commit allows to overwrite this value if needed.
@elkoniu elkoniu force-pushed the org.osbuild.ovf-add-parameter branch from 1e11892 to 05fbf57 Compare April 26, 2024 08:55
@@ -22,7 +22,7 @@ OVF_TEMPLATE = """<?xml version="1.0"?>
<VirtualSystem ovf:id="image">
<Info>A virtual machine</Info>
<Name>VM</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other26xLinux64Guest">
<OperatingSystemSection ovf:id="100" vmw:osType={"ostype"}>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<OperatingSystemSection ovf:id="100" vmw:osType={"ostype"}>
<OperatingSystemSection ovf:id="100" vmw:osType={ostype}>

need to drop the quotes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch, it seems the string is also not an f-string so that would need changing too.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

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

This looks good, once tests are added (and the issue that Achilleas found is fixed which the tests should also cover) this can go in

@@ -22,7 +22,7 @@ OVF_TEMPLATE = """<?xml version="1.0"?>
<VirtualSystem ovf:id="image">
<Info>A virtual machine</Info>
<Name>VM</Name>
<OperatingSystemSection ovf:id="100" vmw:osType="other26xLinux64Guest">
<OperatingSystemSection ovf:id="100" vmw:osType={"ostype"}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch, it seems the string is also not an f-string so that would need changing too.

Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

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

One concern I'd have is that allowing any string allows passing in strings that will break the XML; perhaps we should either escape the value in an attribute context or define a regular expression for the acceptable field values?

Copy link

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 30, 2024
Copy link

github-actions bot commented Jun 7, 2024

This PR was closed because it has been stalled for 30+7 days with no activity.

@github-actions github-actions bot closed this Jun 7, 2024
@elkoniu elkoniu reopened this Jun 11, 2024
@github-actions github-actions bot removed the Stale label Jun 12, 2024
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.

None yet

4 participants