Skip to content

Commit

Permalink
fix(ct): sanitize non set features on import
Browse files Browse the repository at this point in the history
  • Loading branch information
zamrih committed Oct 31, 2023
1 parent 407a61b commit eb8a4c1
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package proxmoxve

import (
"context"
"fmt"
"path/filepath"

Expand Down Expand Up @@ -55,24 +56,33 @@ func Provider() tfbridge.ProviderInfo {

// Create a Pulumi provider mapping
prov := tfbridge.ProviderInfo{
P: p,
Name: "proxmox",
DisplayName: "Proxmox Virtual Environment (Proxmox VE)",
Description: "A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.",
Publisher: "Daniel Muehlbachler-Pietrzykowski",
Keywords: []string{"pulumi", "proxmox", "proxmoxve"},
License: "Apache-2.0",
Homepage: "https://github.com/muhlba91/pulumi-proxmoxve",
Repository: "https://github.com/muhlba91/pulumi-proxmoxve",
LogoURL: "https://raw.githubusercontent.com/muhlba91/pulumi-proxmoxve/main/assets/proxmox-logo.png",
GitHubOrg: "bpg",
PluginDownloadURL: "github://api.github.com/muhlba91/pulumi-proxmoxve",
P: p,
Name: "proxmox",
DisplayName: "Proxmox Virtual Environment (Proxmox VE)",
Description: "A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.",
Publisher: "Daniel Muehlbachler-Pietrzykowski",
Keywords: []string{"pulumi", "proxmox", "proxmoxve"},
License: "Apache-2.0",
Homepage: "https://github.com/muhlba91/pulumi-proxmoxve",
Repository: "https://github.com/muhlba91/pulumi-proxmoxve",
LogoURL: "https://raw.githubusercontent.com/muhlba91/pulumi-proxmoxve/main/assets/proxmox-logo.png",
GitHubOrg: "bpg",
PluginDownloadURL: "github://api.github.com/muhlba91/pulumi-proxmoxve",
Config: map[string]*tfbridge.SchemaInfo{},
PreConfigureCallback: preConfigureCallback,
Resources: map[string]*tfbridge.ResourceInfo{
// VM/CT
"proxmox_virtual_environment_vm": {Tok: tfbridge.MakeResource(mainPkg, vmMod, "VirtualMachine")},
"proxmox_virtual_environment_container": {Tok: tfbridge.MakeResource(mainPkg, containerMod, "Container")},
"proxmox_virtual_environment_vm": {Tok: tfbridge.MakeResource(mainPkg, vmMod, "VirtualMachine")},
"proxmox_virtual_environment_container": {
Tok: tfbridge.MakeResource(mainPkg, containerMod, "Container"),
TransformOutputs: func(ctx context.Context, rpm resource.PropertyMap) (resource.PropertyMap, error) {
const containerResourceContainerFeaturesPropertyKey = resource.PropertyKey("features")
if ! rpm.HasValue(containerResourceContainerFeaturesPropertyKey) {
rpm[containerResourceContainerFeaturesPropertyKey] = resource.NewPropertyValue(resource.NewPropertyValue(""))
}
return rpm, nil
},
},
// Storage
"proxmox_virtual_environment_file": {Tok: tfbridge.MakeResource(mainPkg, storageMod, "File")},
// Environment
Expand Down

0 comments on commit eb8a4c1

Please sign in to comment.