Skip to content

Commit

Permalink
Upgrade terraform-provider-vsphere to v2.7.0 (#448)
Browse files Browse the repository at this point in the history
This PR was generated via `$ upgrade-provider pulumi/pulumi-vsphere`.

---

- Upgrading terraform-provider-vsphere from 2.6.1  to 2.7.0.
	Fixes #443
  • Loading branch information
iwahbe authored Mar 12, 2024
1 parent 23b7ccf commit 407e687
Show file tree
Hide file tree
Showing 51 changed files with 6,039 additions and 725 deletions.
360 changes: 183 additions & 177 deletions patches/0001-fork.patch

Large diffs are not rendered by default.

758 changes: 758 additions & 0 deletions provider/cmd/pulumi-resource-vsphere/bridge-metadata.json

Large diffs are not rendered by default.

194 changes: 191 additions & 3 deletions provider/cmd/pulumi-resource-vsphere/schema.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions provider/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/pulumi/pulumi-vsphere/provider/v4

go 1.21
go 1.22

toolchain go1.22.1

replace (
github.com/hashicorp/go-getter v1.5.0 => github.com/hashicorp/go-getter v1.4.0
Expand Down Expand Up @@ -212,7 +214,7 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/vmware/govmomi v0.32.0 // indirect
github.com/vmware/govmomi v0.35.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand Down
4 changes: 2 additions & 2 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3000,8 +3000,8 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/vmware/govmomi v0.32.0 h1:Rsdi/HAX5Ebf9Byp/FvBir4sfM7yP5DBUeRlbC6vLBo=
github.com/vmware/govmomi v0.32.0/go.mod h1:JA63Pg0SgQcSjk+LuPzjh3rJdcWBo/ZNCIwbb1qf2/0=
github.com/vmware/govmomi v0.35.0 h1:vN6m2J5ezSJomSTHyKbvpfoEZTn2mGXWg2FFpjRTRp0=
github.com/vmware/govmomi v0.35.0/go.mod h1:VvIo6siOYFKdF9eU7qrY9+j/F99DV/LtSgsOpxFXJAY=
github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI=
github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
Expand Down
36 changes: 14 additions & 22 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package vsphere
import (
"fmt"
"path/filepath"
"unicode"

_ "embed" // Allow embedding state

"github.com/hashicorp/terraform-provider-vsphere/vsphere"

"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
tfbridgetokens "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
"github.com/pulumi/pulumi/sdk/v3/go/common/tokens"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"

"github.com/pulumi/pulumi-vsphere/provider/v4/pkg/version"
)
Expand All @@ -21,29 +21,15 @@ const (
vsphereMod = "index"
)

// vsphereMember manufactures a type token for the VSphere package and the given module and type.
func vsphereMember(mod string, mem string) tokens.ModuleMember {
return tokens.ModuleMember(vspherePkg + ":" + mod + ":" + mem)
}
//go:embed cmd/pulumi-resource-vsphere/bridge-metadata.json
var metadata []byte

// vsphereType manufactures a type token for the VSphere package and the given module and type.
func vsphereType(mod string, typ string) tokens.Type {
return tokens.Type(vsphereMember(mod, typ))
}

// vsphereDataSource manufactures a standard resource token given a module and resource name.
// It automatically uses the VSphere package and names the file by simply lower casing the data
// source's first character.
func vsphereDataSource(mod string, res string) tokens.ModuleMember {
fn := string(unicode.ToLower(rune(res[0]))) + res[1:]
return vsphereMember(mod+"/"+fn, res)
return tfbridge.MakeDataSource(vspherePkg, mod, res)
}

// vsphereResource manufactures a standard resource token given a module and resource name.
// package and names the file by simply lower casing the resource's first character.
func vsphereResource(mod string, res string) tokens.Type {
fn := string(unicode.ToLower(rune(res[0]))) + res[1:]
return vsphereType(mod+"/"+fn, res)
return tfbridge.MakeResource(vspherePkg, mod, res)
}

func Provider() tfbridge.ProviderInfo {
Expand All @@ -58,6 +44,8 @@ func Provider() tfbridge.ProviderInfo {
Repository: "https://github.com/pulumi/pulumi-vsphere",
GitHubOrg: "hashicorp",
UpstreamRepoPath: "./upstream",
Version: version.Version,
MetadataInfo: tfbridge.NewProviderMetadata(metadata),
Config: map[string]*tfbridge.SchemaInfo{
"allow_unverified_ssl": {
Default: &tfbridge.DefaultInfo{
Expand Down Expand Up @@ -175,6 +163,10 @@ func Provider() tfbridge.ProviderInfo {
"vsphere_ovf_vm_template": {Tok: vsphereDataSource(vsphereMod, "getOvfVmTemplate")},
"vsphere_compute_cluster_host_group": {Tok: vsphereDataSource(vsphereMod, "getComputeClusterHostGroup")},
"vsphere_license": {Tok: vsphereDataSource(vsphereMod, "getLicense")},

"vsphere_datastore_stats": {Docs: &tfbridge.DocInfo{
Source: "datastore_stats.html .markdown", // Note extra space.
}},
},
JavaScript: &tfbridge.JavaScriptInfo{
Dependencies: map[string]string{
Expand Down Expand Up @@ -218,10 +210,10 @@ func Provider() tfbridge.ProviderInfo {
},
}

err := prov.ComputeTokens(tfbridgetokens.SingleModule("vsphere_", vsphereMod,
prov.MustComputeTokens(tfbridgetokens.SingleModule("vsphere_", vsphereMod,
tfbridgetokens.MakeStandard(vspherePkg)))
contract.AssertNoErrorf(err, "failed to compute default modules")
prov.SetAutonaming(255, "-")
prov.MustApplyAutoAliases()

return prov
}
39 changes: 38 additions & 1 deletion sdk/dotnet/GetDatastore.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 407e687

Please sign in to comment.