Skip to content

Commit

Permalink
Merge branch 'lblackstone/schema' into lukehoban/schema
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
lblackstone committed Mar 17, 2020
2 parents 4fa2fd0 + f8c2d49 commit 5dba8a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ require (

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.1+incompatible

// TODO[pulumi/pulumi#4063]: Until this is merged, pick up a version that supports link-style dependencies.
replace github.com/pulumi/pulumi => github.com/pulumi/pulumi v1.12.2-0.20200312052219-5e3f25cf3cdc
// Temporarily pin to this commit to support schema-based Go SDK generation.
// Can remove this and update the pulumi/pulumi module requirement once v1.12.2 is released.
replace github.com/pulumi/pulumi => github.com/pulumi/pulumi v1.12.2-0.20200317200943-655839009a98
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/pulumi/pulumi v1.12.2-0.20200312052219-5e3f25cf3cdc h1:Udt+UYTDZrdyAmdv5G0Hd9NzX3NA1wcAs2qEEjFxRkc=
github.com/pulumi/pulumi v1.12.2-0.20200312052219-5e3f25cf3cdc/go.mod h1:wem+vUldHRqBV0Q7+yHmQfjYFfVslMCtWW60yqmo9Ag=
github.com/pulumi/pulumi v1.12.2-0.20200317200943-655839009a98 h1:ut+V4PTvJYJOQ6Z5Qo4XcCC9vO0SJUrLQo6WkzqAgSY=
github.com/pulumi/pulumi v1.12.2-0.20200317200943-655839009a98/go.mod h1:wem+vUldHRqBV0Q7+yHmQfjYFfVslMCtWW60yqmo9Ag=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
Expand Down
6 changes: 5 additions & 1 deletion pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
},
}

goImportPath := "github.com/pulumi/pulumi-kubernetes/sdk/go/kubernetes"

csharpNamespaces := map[string]string{}
modToPkg := map[string]string{}
pkgImportAliases := map[string]string{}
Expand All @@ -146,7 +148,8 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
tok := fmt.Sprintf(`kubernetes:%s:%s`, kind.canonicalGV, kind.kind)

modToPkg[kind.canonicalGV] = kind.schemaPkgName
pkgImportAliases[kind.schemaPkgName] = strings.Replace(kind.schemaPkgName, "/", "", -1)
pkgImportAliases[fmt.Sprintf("%s/%s", goImportPath, kind.schemaPkgName)] = strings.Replace(
kind.schemaPkgName, "/", "", -1)

objectSpec := pschema.ObjectTypeSpec{
Description: kind.Comment(),
Expand Down Expand Up @@ -201,6 +204,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
"namespaces": csharpNamespaces,
})
pkg.Language["go"] = rawMessage(map[string]interface{}{
"importBasePath": goImportPath,
"moduleToPackage": modToPkg,
"packageImportAliases": pkgImportAliases,
})
Expand Down

0 comments on commit 5dba8a9

Please sign in to comment.