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

[Issue 196] feature: datasource to find VM in cluster #295

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

castorsky
Copy link

I have implemented a datasource which was described in #196.

This datasource searches the PVE cluster for some VMs that matches specified filters and returns VM ID for one (and only one) guest. I have chosen such behavior because it will be straightforward for proxmox-clone builder - there will be no need for user to manipulate lists in locals.

I have included some tests and documentation for datasource (but since this is my very first attempt to publish my work for Packer I may have missed something).

This datasource uses undocumented meta field from Proxmox API responses. (But the Proxmox team recommended using this field to determine guest creation time in the forum messages).

Closes #196

@castorsky castorsky requested a review from a team as a code owner October 21, 2024 22:58
Copy link

hashicorp-cla-app bot commented Oct 21, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@castorsky castorsky force-pushed the feature/datasource-template branch from 2599b9a to 155f985 Compare November 20, 2024 22:23
Basic configuration verification copied from builder.
Template in directory test-fixtures works.
@castorsky castorsky force-pushed the feature/datasource-template branch from 155f985 to 5740ec7 Compare December 4, 2024 23:08
Copy link
Contributor

@mogrogan mogrogan left a comment

Choose a reason for hiding this comment

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

Thank you for your solid contribution!

I've left 2 comments but it seems pretty good.

datasource/proxmox/data.go Outdated Show resolved Hide resolved
Used anonymous functions instead of a bunch of named ones.
Renamed package and corrected documentation accordingly.
@castorsky
Copy link
Author

In the process of renaming the function and editing the documentation, I noticed two edge cases and fixed them

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.

Datasource for finding existing VMs
2 participants