0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-24 20:38:34 +00:00

suppress duplication error in linter, fix example code

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-08-14 18:23:41 -04:00
parent b15d783658
commit 7fd3848dba
No known key found for this signature in database
GPG Key ID: 637146A2A6804C59
4 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,6 @@
data "proxmox_virtual_environment_containers" "example" {
depends_on = [proxmox_virtual_environment_container.example]
tags = ["ubuntu"]
tags = ["example"]
lifecycle {
postcondition {
@ -12,7 +12,7 @@ data "proxmox_virtual_environment_containers" "example" {
data "proxmox_virtual_environment_containers" "template_example" {
depends_on = [proxmox_virtual_environment_container.example]
tags = ["ubuntu"]
tags = ["example"]
filter {
name = "template"
@ -23,12 +23,6 @@ data "proxmox_virtual_environment_containers" "template_example" {
name = "status"
values = ["running"]
}
filter {
name = "name"
regex = true
values = [".*ubuntu.*"]
}
}
output "proxmox_virtual_environment_containers_example" {
@ -37,4 +31,4 @@ output "proxmox_virtual_environment_containers_example" {
output "proxmox_virtual_environment_template_containers_example" {
value = data.proxmox_virtual_environment_containers.template_example.containers
}
}

View File

@ -73,6 +73,11 @@ resource "proxmox_virtual_environment_container" "example" {
vm_id = proxmox_virtual_environment_container.example_template.id
}
tags = [
"container",
]
initialization {
hostname = "terraform-provider-proxmox-example-lxc"
}

View File

@ -30,6 +30,8 @@ const (
)
// Containers returns a resource for the Proxmox Containers.
//
//nolint:dupl // TODO: refactor to avoid duplication
func Containers() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
@ -198,6 +200,7 @@ func containersRead(ctx context.Context, d *schema.ResourceData, m interface{})
return diags
}
//nolint:dupl // TODO: refactor to avoid duplication
func checkContainerMatchFilters(container map[string]interface{}, filters []interface{}) (bool, error) {
for _, v := range filters {
filter := v.(map[string]interface{})

View File

@ -35,6 +35,8 @@ const (
)
// VMs returns a resource for the Proxmox VMs.
//
//nolint:dupl // TODO: refactor to avoid duplication
func VMs() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
@ -225,6 +227,7 @@ func getNodeNames(ctx context.Context, d *schema.ResourceData, api proxmox.Clien
return nodeNames, nil
}
//nolint:dupl // TODO: refactor to avoid duplication
func checkVMMatchFilters(vm map[string]interface{}, filters []interface{}) (bool, error) {
for _, v := range filters {
filter := v.(map[string]interface{})