Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go SDK using latest codegen packages #1089

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Bug Fixes

- Update Go SDK using latest codegen packages. (https://github.com/pulumi/pulumi-kubernetes/pull/1089)
- Fix schema type for Fields and RawExtension. (https://github.com/pulumi/pulumi-kubernetes/pull/1086)
- Fix error parsing YAML in python 3.8 (https://github.com/pulumi/pulumi-kubernetes/pull/1079)
- Fix HELM_HOME handling for Helm v3. (https://github.com/pulumi/pulumi-kubernetes/pull/1076)
Expand Down
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func writeGoClient(data map[string]interface{}, outdir string) {

func genPulumiSchemaPackage(data map[string]interface{}) *schema.Package {
pkgSpec := gen.PulumiSchema(data)
pkg, err := schema.ImportSpec(pkgSpec)
pkg, err := schema.ImportSpec(pkgSpec, nil)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
github.com/imdario/mergo v0.3.8
github.com/mitchellh/go-wordwrap v1.0.0
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi/pkg/v2 v2.0.0
github.com/pulumi/pulumi/sdk/v2 v2.0.0
github.com/pulumi/pulumi/pkg/v2 v2.1.0
github.com/pulumi/pulumi/sdk/v2 v2.1.0
github.com/stretchr/testify v1.5.1
google.golang.org/grpc v1.28.0
k8s.io/api v0.17.0
Expand Down
8 changes: 6 additions & 2 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ=
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -435,10 +437,12 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/pulumi/pulumi/pkg/v2 v2.0.0 h1:5rBPG2Wnoqgbt4Fz1MbahtE4gLxaPdwI9sr1zaV6lUs=
github.com/pulumi/pulumi/pkg/v2 v2.0.0/go.mod h1:kNG9MBTdKP9AzMgkETumR3fmX9gUYB+HpQL767K6jXc=
github.com/pulumi/pulumi/pkg/v2 v2.1.0 h1:L/gaZ4XQGLODxzXu1SVfIHUHWCR8ENO4mYQnpv6u+Go=
github.com/pulumi/pulumi/pkg/v2 v2.1.0/go.mod h1:NadTQy17wc69lQt/xTl5b6/fbl/tBiOPYMIZ+M/KtBI=
github.com/pulumi/pulumi/sdk/v2 v2.0.0 h1:3VMXbEo3bqeaU+YDt8ufVBLD0WhLYE3tG3t/nIZ3Iac=
github.com/pulumi/pulumi/sdk/v2 v2.0.0/go.mod h1:W7k1UDYerc5o97mHnlHHp5iQZKEby+oQrQefWt+2RF4=
github.com/pulumi/pulumi/sdk/v2 v2.1.0 h1:NZCLrvggMHlBzsaAcvChdDhQ5i9vJxARnLCY7NCFl18=
github.com/pulumi/pulumi/sdk/v2 v2.1.0/go.mod h1:W7k1UDYerc5o97mHnlHHp5iQZKEby+oQrQefWt+2RF4=
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
Expand Down
37 changes: 7 additions & 30 deletions provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
Description: "BETA FEATURE - If present and set to true, enable server-side diff calculations.\nThis feature is in developer preview, and is disabled by default.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `enableDryRun` parameter.\n2. The `PULUMI_K8S_ENABLE_DRY_RUN` environment variable.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"renderYamlToDirectory": {
Description: "BETA FEATURE - If present, render resource manifests to this directory. In this mode, resources will not\nbe created on a Kubernetes cluster, but the rendered manifests will be kept in sync with changes\nto the Pulumi program. This feature is in developer preview, and is disabled by default.\n\nNote that some computed Outputs such as status fields will not be populated\nsince the resources are not created on a Kubernetes cluster. These Output values will remain undefined,\nand may result in an error if they are referenced by other resources. Also note that any secret values\nused in these resources will be rendered in plaintext to the resulting YAML.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"suppressDeprecationWarnings": {
Description: "If present and set to true, suppress apiVersion deprecation warnings from the CLI.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `suppressDeprecationWarnings` parameter.\n2. The `PULUMI_K8S_SUPPRESS_DEPRECATION_WARNINGS` environment variable.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
Expand All @@ -101,34 +105,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
Types: map[string]pschema.ObjectTypeSpec{},
Resources: map[string]pschema.ResourceSpec{},
Functions: map[string]pschema.FunctionSpec{},
Language: map[string]json.RawMessage{
"nodejs": rawMessage(map[string]interface{}{
"dependencies": map[string]string{
"@pulumi/pulumi": "^2.0.0-beta.3",
"shell-quote": "^1.6.1",
"tmp": "^0.0.33",
"@types/tmp": "^0.0.33",
"glob": "^7.1.2",
"@types/glob": "^5.0.35",
"node-fetch": "^2.3.0",
"@types/node-fetch": "^2.1.4",
},
"devDependencies": map[string]string{
"mocha": "^5.2.0",
"@types/mocha": "^5.2.5",
"@types/shell-quote": "^1.6.0",
},
}),
"python": rawMessage(map[string]interface{}{
"requires": map[string]string{
"pulumi": ">=2.0.0b2,<3.0.0",
"requests": ">=2.21.0,<2.22.0",
"pyyaml": ">=5.1,<5.2",
"semver": ">=2.8.1",
"parver": ">=0.2.1",
},
}),
},
Language: map[string]json.RawMessage{},
}

goImportPath := "github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes"
Expand Down Expand Up @@ -210,7 +187,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
})
pkg.Language["nodejs"] = rawMessage(map[string]interface{}{
"dependencies": map[string]string{
"@pulumi/pulumi": "^1.14.0",
"@pulumi/pulumi": "^2.0.0",
"shell-quote": "^1.6.1",
"tmp": "^0.0.33",
"@types/tmp": "^0.0.33",
Expand All @@ -228,7 +205,7 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
})
pkg.Language["python"] = rawMessage(map[string]interface{}{
"requires": map[string]string{
"pulumi": ">=1.11.0,<2.0.0",
"pulumi": ">=2.0.0,<3.0.0",
"requests": ">=2.21.0,<2.22.0",
"pyyaml": ">=5.1,<5.2",
"semver": ">=2.8.1",
Expand Down
49 changes: 42 additions & 7 deletions sdk/go/kubernetes/admissionregistration/v1/pulumiTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,22 +852,42 @@ func (o ServiceReferencePtrOutput) Elem() ServiceReferenceOutput {

// `name` is the name of the service. Required
func (o ServiceReferencePtrOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Name }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Name
}).(pulumi.StringPtrOutput)
}

// `namespace` is the namespace of the service. Required
func (o ServiceReferencePtrOutput) Namespace() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Namespace }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Namespace
}).(pulumi.StringPtrOutput)
}

// `path` is an optional URL path which will be sent in any request to this service.
func (o ServiceReferencePtrOutput) Path() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Path }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Path
}).(pulumi.StringPtrOutput)
}

// If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).
func (o ServiceReferencePtrOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v ServiceReference) *int { return v.Port }).(pulumi.IntPtrOutput)
return o.ApplyT(func(v *ServiceReference) *int {
if v == nil {
return nil
}
return v.Port
}).(pulumi.IntPtrOutput)
}

// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
Expand Down Expand Up @@ -1555,14 +1575,24 @@ func (o WebhookClientConfigPtrOutput) Elem() WebhookClientConfigOutput {

// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
func (o WebhookClientConfigPtrOutput) CaBundle() pulumi.StringPtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *string { return v.CaBundle }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *string {
if v == nil {
return nil
}
return v.CaBundle
}).(pulumi.StringPtrOutput)
}

// `service` is a reference to the service for this webhook. Either `service` or `url` must be specified.
//
// If the webhook is running within the cluster, then you should use `service`.
func (o WebhookClientConfigPtrOutput) Service() ServiceReferencePtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *ServiceReference { return v.Service }).(ServiceReferencePtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *ServiceReference {
if v == nil {
return nil
}
return v.Service
}).(ServiceReferencePtrOutput)
}

// `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.
Expand All @@ -1577,7 +1607,12 @@ func (o WebhookClientConfigPtrOutput) Service() ServiceReferencePtrOutput {
//
// Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either.
func (o WebhookClientConfigPtrOutput) Url() pulumi.StringPtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *string { return v.Url }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *string {
if v == nil {
return nil
}
return v.Url
}).(pulumi.StringPtrOutput)
}

func init() {
Expand Down
49 changes: 42 additions & 7 deletions sdk/go/kubernetes/admissionregistration/v1beta1/pulumiTypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,22 +852,42 @@ func (o ServiceReferencePtrOutput) Elem() ServiceReferenceOutput {

// `name` is the name of the service. Required
func (o ServiceReferencePtrOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Name }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Name
}).(pulumi.StringPtrOutput)
}

// `namespace` is the namespace of the service. Required
func (o ServiceReferencePtrOutput) Namespace() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Namespace }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Namespace
}).(pulumi.StringPtrOutput)
}

// `path` is an optional URL path which will be sent in any request to this service.
func (o ServiceReferencePtrOutput) Path() pulumi.StringPtrOutput {
return o.ApplyT(func(v ServiceReference) *string { return v.Path }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *ServiceReference) *string {
if v == nil {
return nil
}
return v.Path
}).(pulumi.StringPtrOutput)
}

// If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).
func (o ServiceReferencePtrOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v ServiceReference) *int { return v.Port }).(pulumi.IntPtrOutput)
return o.ApplyT(func(v *ServiceReference) *int {
if v == nil {
return nil
}
return v.Port
}).(pulumi.IntPtrOutput)
}

// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
Expand Down Expand Up @@ -1555,14 +1575,24 @@ func (o WebhookClientConfigPtrOutput) Elem() WebhookClientConfigOutput {

// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
func (o WebhookClientConfigPtrOutput) CaBundle() pulumi.StringPtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *string { return v.CaBundle }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *string {
if v == nil {
return nil
}
return v.CaBundle
}).(pulumi.StringPtrOutput)
}

// `service` is a reference to the service for this webhook. Either `service` or `url` must be specified.
//
// If the webhook is running within the cluster, then you should use `service`.
func (o WebhookClientConfigPtrOutput) Service() ServiceReferencePtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *ServiceReference { return v.Service }).(ServiceReferencePtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *ServiceReference {
if v == nil {
return nil
}
return v.Service
}).(ServiceReferencePtrOutput)
}

// `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.
Expand All @@ -1577,7 +1607,12 @@ func (o WebhookClientConfigPtrOutput) Service() ServiceReferencePtrOutput {
//
// Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either.
func (o WebhookClientConfigPtrOutput) Url() pulumi.StringPtrOutput {
return o.ApplyT(func(v WebhookClientConfig) *string { return v.Url }).(pulumi.StringPtrOutput)
return o.ApplyT(func(v *WebhookClientConfig) *string {
if v == nil {
return nil
}
return v.Url
}).(pulumi.StringPtrOutput)
}

func init() {
Expand Down
Loading