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

feat(lxc): add container datasource #1750

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

Conversation

h3krn
Copy link
Contributor

@h3krn h3krn commented Feb 7, 2025

Contributor's Note

  • I have added / updated documentation in /docs for any user-facing features or additions.
  • I have added / updated acceptance tests in /fwprovider/tests for any new or updated resources / data sources.
  • I have ran make example to verify that the change works as expected.

Proof of Work

$ cat datasource.tf 
data "proxmox_virtual_environment_container" "test" {
  vm_id = "133"
  node_name    = "pve-host"
}

output "ip_address" {
  value = data.proxmox_virtual_environment_container.test
}
$ tofu apply
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - bpg/proxmox in /home/harm/go/bin
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
data.proxmox_virtual_environment_container.test: Reading...
data.proxmox_virtual_environment_container.test: Read complete after 0s [id=133]

Changes to Outputs:
  + ip_address = {
      + id        = "133"
      + name      = "k3s-controller-02"
      + node_name = "pve-host"
      + status    = "running"
      + tags      = [
          + "k3s_cluster",
          + "master",
        ]
      + template  = false
      + vm_id     = 133
    }

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #965

@h3krn h3krn marked this pull request as draft February 7, 2025 20:53
@bpg
Copy link
Owner

bpg commented Feb 9, 2025

Hey @h3krn 👋🏼

Thanks for adding this feature! Let me know if you need a hand to finish it.

@h3krn
Copy link
Contributor Author

h3krn commented Feb 10, 2025

Hi @bpg,

Thanks, while I do know some programming (mainly python, bash and some perl and C from the old days)
I'm really new to golang. So have a lot to learn and my PR's won't be rocket science.

Technically the PR as is works, but I'm trying to find out what it would take to clear the linter warning. The vm and lxc API endpoints seem fairly similar, but I'll try to figure out if they are actually identical and if it's worth to parametrize this and avoid duplication (without shooting myself in the foot).
If this is not the case, would it be acceptable to silence this specific linter warning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

container datasource
2 participants