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:
parent
b15d783658
commit
7fd3848dba
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
|
@ -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{})
|
||||
|
@ -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{})
|
||||
|
Loading…
Reference in New Issue
Block a user