diff --git a/example/data_source_virtual_environment_containers.tf b/example/data_source_virtual_environment_containers.tf index 43a57427..f7a4024d 100644 --- a/example/data_source_virtual_environment_containers.tf +++ b/example/data_source_virtual_environment_containers.tf @@ -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 -} \ No newline at end of file +} diff --git a/example/resource_virtual_environment_container.tf b/example/resource_virtual_environment_container.tf index 3ebb9d93..0e9f3e70 100644 --- a/example/resource_virtual_environment_container.tf +++ b/example/resource_virtual_environment_container.tf @@ -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" } diff --git a/proxmoxtf/datasource/containers.go b/proxmoxtf/datasource/containers.go index 9e07fdce..0a49d7ee 100644 --- a/proxmoxtf/datasource/containers.go +++ b/proxmoxtf/datasource/containers.go @@ -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{}) diff --git a/proxmoxtf/datasource/vms.go b/proxmoxtf/datasource/vms.go index 72384356..1f9b025c 100644 --- a/proxmoxtf/datasource/vms.go +++ b/proxmoxtf/datasource/vms.go @@ -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{})