From dbcc2f97ee7e670d971164d60079f876a0f91f69 Mon Sep 17 00:00:00 2001 From: Levi Blackstone Date: Tue, 9 Nov 2021 17:10:01 -0700 Subject: [PATCH] Go fixes --- provider/cmd/pulumi-gen-kubernetes/main.go | 9 +++++++++ provider/go.mod | 2 +- provider/go.sum | 4 ++-- provider/pkg/gen/overlays.go | 2 +- sdk/go/kubernetes/apiextensions/init.go | 5 +++++ sdk/go/kubernetes/helm/v2/init.go | 7 ++++++- sdk/go/kubernetes/kustomize/init.go | 5 +++++ sdk/go/kubernetes/yaml/init.go | 5 +++++ tests/go.mod | 2 +- tests/go.sum | 4 ++-- 10 files changed, 37 insertions(+), 8 deletions(-) diff --git a/provider/cmd/pulumi-gen-kubernetes/main.go b/provider/cmd/pulumi-gen-kubernetes/main.go index 925af80f53..3a4ba982d4 100644 --- a/provider/cmd/pulumi-gen-kubernetes/main.go +++ b/provider/cmd/pulumi-gen-kubernetes/main.go @@ -340,6 +340,15 @@ func writeGoClient(pkg *schema.Package, outdir string, templateDir string) { } } + // Go codegen maps package to "v3" for Helm Release. Manually rename to + // helm to avoid conflict with existing templates. + renamePackage([]string{ + "kubernetes/helm/v2/pulumiTypes.go", + "kubernetes/helm/v2/init.go", + }, + "package v2", + "package helm") + // Go codegen maps package to "v3" for Helm Release. Manually rename to // helm to avoid conflict with existing templates. renamePackage([]string{ diff --git a/provider/go.mod b/provider/go.mod index 30b07036d5..96fd8c8717 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -10,7 +10,7 @@ require ( github.com/imdario/mergo v0.3.12 github.com/mitchellh/mapstructure v1.4.1 github.com/pkg/errors v0.9.1 - github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977 + github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93 github.com/pulumi/pulumi/sdk/v3 v3.17.0 github.com/stretchr/testify v1.7.0 golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a diff --git a/provider/go.sum b/provider/go.sum index 68f531d949..06424d6583 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -946,8 +946,8 @@ github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977 h1:CSZSlXWzbdUi60GdV9TPKZOgRoIMvP8MzVY9Ahf6Ejk= -github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977/go.mod h1:cqMzfxnyy3h/fzN6aN0LnERXEVmKECFGP94Wd6g2oqU= +github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93 h1:E1ElJDSsdskqAeNUkUDGpv1H87ph1MQZDDACF80+wRc= +github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93/go.mod h1:cqMzfxnyy3h/fzN6aN0LnERXEVmKECFGP94Wd6g2oqU= github.com/pulumi/pulumi/sdk/v3 v3.17.0 h1:CxdgdmFEvo99JviXP6d332Y2AyAIPbLI6fu4K33vhAg= github.com/pulumi/pulumi/sdk/v3 v3.17.0/go.mod h1:252ou/zAU1g6E8iTwe2Y9ht7pb5BDl2fJlOuAgZCHiA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= diff --git a/provider/pkg/gen/overlays.go b/provider/pkg/gen/overlays.go index ffe8e6dc12..43feef2fc5 100644 --- a/provider/pkg/gen/overlays.go +++ b/provider/pkg/gen/overlays.go @@ -15,7 +15,7 @@ package gen import ( - _ "embed" + _ "embed" // Needed to support go:embed directive pschema "github.com/pulumi/pulumi/pkg/v3/codegen/schema" v1 "k8s.io/api/core/v1" diff --git a/sdk/go/kubernetes/apiextensions/init.go b/sdk/go/kubernetes/apiextensions/init.go index 2924e91166..08a974550b 100644 --- a/sdk/go/kubernetes/apiextensions/init.go +++ b/sdk/go/kubernetes/apiextensions/init.go @@ -34,4 +34,9 @@ func init() { if err != nil { fmt.Printf("failed to determine package version. defaulting to v1: %v\n", err) } + pulumi.RegisterResourceModule( + "kubernetes", + "apiextensions.k8s.io", + &module{version}, + ) } diff --git a/sdk/go/kubernetes/helm/v2/init.go b/sdk/go/kubernetes/helm/v2/init.go index c5c15519b5..7cda7d44bf 100644 --- a/sdk/go/kubernetes/helm/v2/init.go +++ b/sdk/go/kubernetes/helm/v2/init.go @@ -1,7 +1,7 @@ // *** WARNING: this file was generated by pulumigen. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** -package v2 +package helm import ( "fmt" @@ -34,4 +34,9 @@ func init() { if err != nil { fmt.Printf("failed to determine package version. defaulting to v1: %v\n", err) } + pulumi.RegisterResourceModule( + "kubernetes", + "helm.sh/v2", + &module{version}, + ) } diff --git a/sdk/go/kubernetes/kustomize/init.go b/sdk/go/kubernetes/kustomize/init.go index 22efb25ddc..1da5e5b128 100644 --- a/sdk/go/kubernetes/kustomize/init.go +++ b/sdk/go/kubernetes/kustomize/init.go @@ -34,4 +34,9 @@ func init() { if err != nil { fmt.Printf("failed to determine package version. defaulting to v1: %v\n", err) } + pulumi.RegisterResourceModule( + "kubernetes", + "kustomize", + &module{version}, + ) } diff --git a/sdk/go/kubernetes/yaml/init.go b/sdk/go/kubernetes/yaml/init.go index 012d5815f6..17850f23f1 100644 --- a/sdk/go/kubernetes/yaml/init.go +++ b/sdk/go/kubernetes/yaml/init.go @@ -34,4 +34,9 @@ func init() { if err != nil { fmt.Printf("failed to determine package version. defaulting to v1: %v\n", err) } + pulumi.RegisterResourceModule( + "kubernetes", + "yaml", + &module{version}, + ) } diff --git a/tests/go.mod b/tests/go.mod index 8a83eee2df..58f6b5536b 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -12,7 +12,7 @@ replace ( require ( github.com/pulumi/pulumi-kubernetes/provider/v3 v3.0.0-rc.1 github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.0.0-rc.1 - github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977 + github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93 github.com/pulumi/pulumi/sdk/v3 v3.17.0 github.com/stretchr/testify v1.7.0 ) diff --git a/tests/go.sum b/tests/go.sum index c8a4de0cdb..f6f07b8e21 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -968,8 +968,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977 h1:CSZSlXWzbdUi60GdV9TPKZOgRoIMvP8MzVY9Ahf6Ejk= -github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109050240-8bb56afef977/go.mod h1:cqMzfxnyy3h/fzN6aN0LnERXEVmKECFGP94Wd6g2oqU= +github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93 h1:E1ElJDSsdskqAeNUkUDGpv1H87ph1MQZDDACF80+wRc= +github.com/pulumi/pulumi/pkg/v3 v3.17.1-0.20211109235855-ad858a804d93/go.mod h1:cqMzfxnyy3h/fzN6aN0LnERXEVmKECFGP94Wd6g2oqU= github.com/pulumi/pulumi/sdk/v3 v3.16.0/go.mod h1:252ou/zAU1g6E8iTwe2Y9ht7pb5BDl2fJlOuAgZCHiA= github.com/pulumi/pulumi/sdk/v3 v3.17.0 h1:CxdgdmFEvo99JviXP6d332Y2AyAIPbLI6fu4K33vhAg= github.com/pulumi/pulumi/sdk/v3 v3.17.0/go.mod h1:252ou/zAU1g6E8iTwe2Y9ht7pb5BDl2fJlOuAgZCHiA=