Skip to content

Commit

Permalink
feat: Managed by Terraform. (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinyblargon authored Nov 25, 2024
1 parent cbc3a2d commit b3e1ffe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion proxmox/resource_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

const schemaPoolComment = "comment"

var poolResourceDef *schema.Resource

func resourcePool() *schema.Resource {
Expand All @@ -26,8 +28,9 @@ func resourcePool() *schema.Resource {
Required: true,
ForceNew: true,
},
"comment": {
schemaPoolComment: {
Type: schema.TypeString,
Default: defaultDescription,
Optional: true,
},
},
Expand Down
6 changes: 4 additions & 2 deletions proxmox/resource_vm_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ const (
)

const (
schemaQemuDescription = "desc"

schemaAdditionalWait = "additional_wait"
schemaAgentTimeout = "agent_timeout"
schemaSkipIPv4 = "skip_ipv4"
Expand Down Expand Up @@ -135,13 +137,13 @@ func resourceVmQemu() *schema.Resource {
return
},
},
"desc": {
schemaQemuDescription: {
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return strings.TrimSpace(old) == strings.TrimSpace(new)
},
// Default: "",
Default: defaultDescription,
Description: "The VM description",
},
"target_node": {
Expand Down
2 changes: 1 addition & 1 deletion proxmox/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/rs/zerolog"
)

// const defaultTimeout = 300
const defaultDescription = "Managed by Terraform."

var rxRsId = regexp.MustCompile(`([^/]+)/([^/]+)/(\d+)`)

Expand Down

0 comments on commit b3e1ffe

Please sign in to comment.