Skip to content

Commit

Permalink
feat: add PluginDownloadUrl for GitHub releases
Browse files Browse the repository at this point in the history
  • Loading branch information
muhlba91 committed Jan 16, 2022
1 parent 7e695ce commit 5ae5a31
Show file tree
Hide file tree
Showing 109 changed files with 685 additions and 108 deletions.
2 changes: 2 additions & 0 deletions provider/cmd/pulumi-resource-proxmoxve/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"license": "Apache-2.0",
"attribution": "This Pulumi package is based on the [`proxmoxve` Terraform Provider](https://github.com/bpg/terraform-provider-proxmoxve).",
"repository": "https://github.com/muhlba91/pulumi-proxmoxve",
"pluginDownloadURL": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
Expand Down Expand Up @@ -3952,6 +3953,7 @@
}
},
"go": {
"generateExtraInputTypes": true,
"generateResourceContainerTypes": true,
"importBasePath": "github.com/muhlba91/pulumi-proxmoxve/sdk/go/proxmoxve"
},
Expand Down
4 changes: 2 additions & 2 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ replace (

require (
github.com/bpg/terraform-provider-proxmox v0.5.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0
github.com/pulumi/pulumi/sdk/v3 v3.19.0
github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0
github.com/pulumi/pulumi/sdk/v3 v3.22.1
)
31 changes: 18 additions & 13 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,6 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc=
github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down Expand Up @@ -384,6 +382,7 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -423,8 +422,9 @@ github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk=
github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o=
github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g=
Expand Down Expand Up @@ -496,7 +496,6 @@ github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlz
github.com/hashicorp/terraform-plugin-test/v2 v2.2.1 h1:d3Rzmi5bnRzcAZon91FY4TDCMUYdU8c5vpPpf2Tz+c8=
github.com/hashicorp/terraform-plugin-test/v2 v2.2.1/go.mod h1:eZ9JL3O69Cb71Skn6OhHyj17sLmHRb+H6VrDcJjKrYU=
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE=
Expand Down Expand Up @@ -680,6 +679,7 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A=
github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -715,12 +715,13 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0 h1:KVw2dm/6EVJCGfjiLizg3CDiHZPz73l5qTCOsHk9xjY=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0/go.mod h1:VlFvdieJz0VtsZuzGeRMfEFVZJzLZIwB4+HNHosXrOA=
github.com/pulumi/pulumi/pkg/v3 v3.19.0 h1:4n4M0sk25Iaij6qdzTKE5WCw7Jt6ykbQj089xrs5AxY=
github.com/pulumi/pulumi/pkg/v3 v3.19.0/go.mod h1:EYJ0EUzwpGGavDRlb8gDtK64JMz1XuFAmlCIcHWW0w0=
github.com/pulumi/pulumi/sdk/v3 v3.19.0 h1:nNJQQtXEK8rj/iM4mergHRneVl7GSHe0hK/2MvV7kbo=
github.com/pulumi/pulumi/sdk/v3 v3.19.0/go.mod h1:AnbQmAhp0ezO/MhcVjqkhvoQnxZ0+79Xb035NcuKrtM=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0 h1:od8gjlVjl90J4Pkm/9s00t8Qp+zFr7JT1ur/P2QrGGk=
github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0/go.mod h1:6XmD2LSnYLnzS4jiEvnEYFnBsyEe52wc3Rs37NTpMxM=
github.com/pulumi/pulumi/pkg/v3 v3.22.0 h1:WdxiTbXsm+puD9D514VVo2dSJWG6MnHi9ep3NgXo4PA=
github.com/pulumi/pulumi/pkg/v3 v3.22.0/go.mod h1:qvt0qEDtNTtJxy6IVGNfx8x/xEFeiPtDdfGNhfFh3jk=
github.com/pulumi/pulumi/sdk/v3 v3.22.0/go.mod h1:WHOQB00iuHZyXhwrymxpKXhpOahSguJIpRjVokmM11w=
github.com/pulumi/pulumi/sdk/v3 v3.22.1 h1:xmoxh08lhgQKgFkp8HcQ4NdFuetA5WgvwmY2yBW5wpM=
github.com/pulumi/pulumi/sdk/v3 v3.22.1/go.mod h1:WHOQB00iuHZyXhwrymxpKXhpOahSguJIpRjVokmM11w=
github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e h1:Dik4Qe/+xguB8JagPyXNlbOnRiXGmq/PSPQTGunYnTk=
github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ=
github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20210629210550-59d24255d71f h1:YWtQ7xeRQvB9h5Uwtrl9wDKRKkyLTXWBzU7x0c9VOZ4=
Expand All @@ -731,8 +732,9 @@ github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down Expand Up @@ -842,8 +844,9 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q
github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.3.1/go.mod h1:YO23e2L18AG+ZYQfSobnY4G65nvwvprPCxBHkufUH1k=
github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs=
github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc=
github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0=
github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0=
Expand Down Expand Up @@ -894,8 +897,9 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o=
golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -1081,6 +1085,7 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 h1:c8PlLMqBbOHoqtjteWm5/kbe6rNY2pbRfbIMVnepueo=
Expand Down
1 change: 1 addition & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Provider() tfbridge.ProviderInfo {
Homepage: "https://github.com/muhlba91/pulumi-proxmoxve",
Repository: "https://github.com/muhlba91/pulumi-proxmoxve",
GitHubOrg: "bpg",
PluginDownloadURL: "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}",
Config: map[string]*tfbridge.SchemaInfo{},
PreConfigureCallback: preConfigureCallback,
Resources: map[string]*tfbridge.ResourceInfo{
Expand Down
5 changes: 5 additions & 0 deletions sdk/dotnet/Pulumi.ProxmoxVE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
<None Include="version.txt" Pack="True" PackagePath="content" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="pulumi-plugin.json" />
<None Include="pulumi-plugin.json" Pack="True" PackagePath="content" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pulumi" Version="3.*" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions sdk/dotnet/pulumi-plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"resource": true,
"name": "proxmoxve",
"server": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}"
}
2 changes: 1 addition & 1 deletion sdk/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-alpha.1637516154+bcc93c62.dirty
0.0.1-alpha.1639643795+7e695cee.dirty
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/certifi.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func NewCertifi(ctx *pulumi.Context,
if args.PrivateKey == nil {
return nil, errors.New("invalid value for required argument 'PrivateKey'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Certifi
err := ctx.RegisterResource("proxmoxve:index/certifi:Certifi", name, args, &resource, opts...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/cluster/clusterAlias.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func NewClusterAlias(ctx *pulumi.Context,
if args.Cidr == nil {
return nil, errors.New("invalid value for required argument 'Cidr'")
}
opts = pkgResourceDefaultOpts(opts)
var resource ClusterAlias
err := ctx.RegisterResource("proxmoxve:Cluster/clusterAlias:ClusterAlias", name, args, &resource, opts...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/cluster/clusterIPSet.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewClusterIPSet(ctx *pulumi.Context,
args = &ClusterIPSetArgs{}
}

opts = pkgResourceDefaultOpts(opts)
var resource ClusterIPSet
err := ctx.RegisterResource("proxmoxve:Cluster/clusterIPSet:ClusterIPSet", name, args, &resource, opts...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/cluster/getClusterAlias.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func LookupClusterAlias(ctx *pulumi.Context, args *LookupClusterAliasArgs, opts ...pulumi.InvokeOption) (*LookupClusterAliasResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupClusterAliasResult
err := ctx.Invoke("proxmoxve:Cluster/getClusterAlias:getClusterAlias", args, &rv, opts...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/cluster/getClusterAliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func GetClusterAliases(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetClusterAliasesResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetClusterAliasesResult
err := ctx.Invoke("proxmoxve:Cluster/getClusterAliases:getClusterAliases", nil, &rv, opts...)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/cluster/getNodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func GetNodes(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetNodesResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetNodesResult
err := ctx.Invoke("proxmoxve:Cluster/getNodes:getNodes", nil, &rv, opts...)
if err != nil {
Expand Down
99 changes: 99 additions & 0 deletions sdk/go/proxmoxve/cluster/pulumiUtilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package cluster

import (
"fmt"
"os"
"reflect"
"regexp"
"strconv"
"strings"

"github.com/blang/semver"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

type envParser func(v string) interface{}

func parseEnvBool(v string) interface{} {
b, err := strconv.ParseBool(v)
if err != nil {
return nil
}
return b
}

func parseEnvInt(v string) interface{} {
i, err := strconv.ParseInt(v, 0, 0)
if err != nil {
return nil
}
return int(i)
}

func parseEnvFloat(v string) interface{} {
f, err := strconv.ParseFloat(v, 64)
if err != nil {
return nil
}
return f
}

func parseEnvStringArray(v string) interface{} {
var result pulumi.StringArray
for _, item := range strings.Split(v, ";") {
result = append(result, pulumi.String(item))
}
return result
}

func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} {
for _, v := range vars {
if value := os.Getenv(v); value != "" {
if parser != nil {
return parser(value)
}
return value
}
}
return def
}

// PkgVersion uses reflection to determine the version of the current package.
func PkgVersion() (semver.Version, error) {
type sentinal struct{}
pkgPath := reflect.TypeOf(sentinal{}).PkgPath()
re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?")
if match := re.FindStringSubmatch(pkgPath); match != nil {
vStr := match[1]
if len(vStr) == 0 { // If the version capture group was empty, default to v1.
return semver.Version{Major: 1}, nil
}
return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil
}
return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath)
}

// isZero is a null safe check for if a value is it's types zero value.
func isZero(v interface{}) bool {
if v == nil {
return true
}
return reflect.ValueOf(v).IsZero()
}

// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource.
func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption {
defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")}

return append(defaults, opts...)
}

// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke.
func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption {
defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")}

return append(defaults, opts...)
}
1 change: 1 addition & 0 deletions sdk/go/proxmoxve/ct/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func NewContainer(ctx *pulumi.Context,
if args.NodeName == nil {
return nil, errors.New("invalid value for required argument 'NodeName'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Container
err := ctx.RegisterResource("proxmoxve:CT/container:Container", name, args, &resource, opts...)
if err != nil {
Expand Down
Loading

0 comments on commit 5ae5a31

Please sign in to comment.