Skip to content

Commit

Permalink
Go fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lblackstone committed Nov 10, 2021
1 parent 3f7bfbb commit dbcc2f9
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 8 deletions.
9 changes: 9 additions & 0 deletions provider/cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion provider/pkg/gen/overlays.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions sdk/go/kubernetes/apiextensions/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
}
7 changes: 6 additions & 1 deletion sdk/go/kubernetes/helm/v2/init.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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},
)
}
5 changes: 5 additions & 0 deletions sdk/go/kubernetes/kustomize/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
}
5 changes: 5 additions & 0 deletions sdk/go/kubernetes/yaml/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
}
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 2 additions & 2 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit dbcc2f9

Please sign in to comment.