Skip to content

fix: existing template detection in vsphere-template post-processor#727

Merged
tenthirtyam merged 1 commit into
vmware:mainfrom
karelvanhecke:fix/vsphere-template-post-processor
Jun 10, 2026
Merged

fix: existing template detection in vsphere-template post-processor#727
tenthirtyam merged 1 commit into
vmware:mainfrom
karelvanhecke:fix/vsphere-template-post-processor

Conversation

@karelvanhecke

@karelvanhecke karelvanhecke commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves the logic for finding a template VM by adding an explicit check to ensure the returned VM is actually a template. If the found VM is not a template, the function now returns nil instead of the VM.

In step_mark_as_template.go, the findTemplate function now checks if the located VM is a template using IsTemplate, and only returns the VM if it is indeed a template. If not, it returns nil, preventing incorrect handling of non-template VMs.

Type

  • fix: Bug Fix
  • feat: Feature or Enhancement
  • docs: Documentation
  • refactor: Refactoring
  • chore: Build, Dependencies, Workflows, etc.
  • other: Other (Please describe.)

Breaking Changes?

  • Yes, there are breaking changes.
  • [x ] No, there are no breaking changes.

Tests

  • Tests have been added or updated.
  • Tests have been completed.

Output:

Documentation

  • Documentation has been added or updated.

Issue References

Closes #728

Release Note

- Fix existing template detection in `vsphere-template` post-processor.

Additional Information

@karelvanhecke karelvanhecke requested a review from a team as a code owner June 10, 2026 11:20
@github-actions github-actions Bot added needs-review Needs Review size/xs Relative Sizing: Extra-Small labels Jun 10, 2026
@tenthirtyam

tenthirtyam commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

@karelvanhecke - thanks for this contribution. I can merge this once your commit has a verified signature. You can refer to my blog post Signing Your Git Commits: From Zero to Verified to amend and sign the commit.

Ryan Johnson, Broadcom
Customer sidekick. Open source developer.

@tenthirtyam tenthirtyam added the stage/awaiting-reply Stage: Awaiting Reply label Jun 10, 2026
@tenthirtyam tenthirtyam added this to the v2.2.0 milestone Jun 10, 2026
@tenthirtyam tenthirtyam marked this pull request as draft June 10, 2026 14:49
@tenthirtyam tenthirtyam changed the title fix: existing template detection in vsphere-template post-processor [wip] fix: existing template detection in vsphere-template post-processor Jun 10, 2026
@github-actions github-actions Bot added the needs-review Needs Review label Jun 10, 2026
@tenthirtyam

Copy link
Copy Markdown
Collaborator

Marked as draft until the commit(s) have verified signatures.

Signed-off-by: Karel Van Hecke <25814162+karelvanhecke@users.noreply.github.com>
@karelvanhecke karelvanhecke force-pushed the fix/vsphere-template-post-processor branch from af8f7e5 to 6bea605 Compare June 10, 2026 14:58
@karelvanhecke

Copy link
Copy Markdown
Contributor Author

@tenthirtyam I've signed my commit.

@karelvanhecke karelvanhecke marked this pull request as ready for review June 10, 2026 15:10
@karelvanhecke karelvanhecke changed the title [wip] fix: existing template detection in vsphere-template post-processor fix: existing template detection in vsphere-template post-processor Jun 10, 2026
@tenthirtyam tenthirtyam removed needs-review Needs Review stage/awaiting-reply Stage: Awaiting Reply labels Jun 10, 2026
@tenthirtyam tenthirtyam merged commit ea7fea4 into vmware:main Jun 10, 2026
11 checks passed
@github-actions github-actions Bot added the needs-review Needs Review label Jun 10, 2026
@tenthirtyam tenthirtyam added post-processor/vsphere-template Post-Processor: vsphere-template and removed needs-review Needs Review labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-processor/vsphere-template Post-Processor: vsphere-template size/xs Relative Sizing: Extra-Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vsphere-template: vm incorrectly detected as existing template

2 participants