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

Set supported environment variables in SDK Provider classes #1166

Merged
merged 2 commits into from
Jun 24, 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 @@ -3,6 +3,7 @@
### Improvements

- Fix prometheus-operator test to wait for the CRD to be ready before use (https://github.com/pulumi/pulumi-kubernetes/pull/1172)
- Set supported environment variables in SDK Provider classes (https://github.com/pulumi/pulumi-kubernetes/pull/1166)

## 2.3.1 (June 17, 2020)

Expand Down
4 changes: 2 additions & 2 deletions provider/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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.3.1-0.20200607162109-9754465b04db
github.com/pulumi/pulumi/pkg/v2 v2.4.1-0.20200622153820-282c95ee402d
github.com/pulumi/pulumi/sdk/v2 v2.3.0
github.com/stretchr/testify v1.5.1
github.com/stretchr/testify v1.6.1
google.golang.org/grpc v1.28.0
k8s.io/api v0.18.0
k8s.io/apimachinery v0.18.0
Expand Down
12 changes: 9 additions & 3 deletions provider/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 h1:LoCV5cscNVWyK5ChN/uCoIFJz8jZD63VQiGJIRgr6uo=
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386/go.mod h1:MRxHTJrf9FhdfNQ8Hdeh9gmHevC9RJE/fu8M3JIGjoE=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand All @@ -448,8 +450,8 @@ 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.3.1-0.20200607162109-9754465b04db h1:5HrO1GNA53QEp+yN1UCX7BUsJD2I5/k1u2KLO4hOxOA=
github.com/pulumi/pulumi/pkg/v2 v2.3.1-0.20200607162109-9754465b04db/go.mod h1:aqo0wBboEEdy+T5EYKUB6YnzbL80VPjgJPwjttuHqT0=
github.com/pulumi/pulumi/pkg/v2 v2.4.1-0.20200622153820-282c95ee402d h1:a7+mvsLerdMp/tz1MKYYsAKTtjWPGz9sNzD+UscQRuU=
github.com/pulumi/pulumi/pkg/v2 v2.4.1-0.20200622153820-282c95ee402d/go.mod h1:zfUm4/GH2dVRlHZ3Yeb9bRweCQM7icVBdplu6MUDRrQ=
github.com/pulumi/pulumi/sdk/v2 v2.0.0/go.mod h1:W7k1UDYerc5o97mHnlHHp5iQZKEby+oQrQefWt+2RF4=
github.com/pulumi/pulumi/sdk/v2 v2.3.0 h1:uvRYCmoHILKlyyIbXa5CcLSKKt9n2s8j+GKTffpXQf4=
github.com/pulumi/pulumi/sdk/v2 v2.3.0/go.mod h1:cvivzHVRA5Xu3NSE/obmHzO3L693IJSd5QccQuBOMUE=
Expand Down Expand Up @@ -505,6 +507,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6 h1:9VTskZOIRf2vKF3UL8TuWElry5pgUpV1tFSe/e/0m/E=
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
Expand Down Expand Up @@ -786,7 +790,7 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4=
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
gopkg.in/AlecAivazis/survey.v1 v1.8.8/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo=
gopkg.in/AlecAivazis/survey.v1 v1.8.9-0.20200217094205-6773bdf39b7f/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down Expand Up @@ -818,6 +822,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
15 changes: 15 additions & 0 deletions provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
},
InputProperties: map[string]pschema.PropertySpec{
"kubeconfig": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"KUBECONFIG",
},
},
Description: "The contents of a kubeconfig file. If this is set, this config will be used instead of $KUBECONFIG.",
TypeSpec: pschema.TypeSpec{Type: "string"},
Language: map[string]json.RawMessage{
Expand All @@ -102,6 +107,11 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"enableDryRun": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_ENABLE_DRY_RUN",
},
},
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"},
},
Expand All @@ -110,6 +120,11 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"suppressDeprecationWarnings": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_SUPPRESS_DEPRECATION_WARNINGS",
},
},
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 Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/StatefulSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Pulumi.Kubernetes.Apps.V1
/// StatefulSet represents a set of pods with consistent identities. Identities are defined as:
/// - Network: A single stable DNS and hostname.
/// - Storage: As many VolumeClaims as requested.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
///
/// This resource waits until its status is ready before registering success
/// for create/update, and populating output properties from the current state of the resource.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta1/StatefulSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Pulumi.Kubernetes.Apps.V1Beta1
/// StatefulSet represents a set of pods with consistent identities. Identities are defined as:
/// - Network: A single stable DNS and hostname.
/// - Storage: As many VolumeClaims as requested.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
///
/// This resource waits until its status is ready before registering success
/// for create/update, and populating output properties from the current state of the resource.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/StatefulSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Pulumi.Kubernetes.Apps.V1Beta2
/// StatefulSet represents a set of pods with consistent identities. Identities are defined as:
/// - Network: A single stable DNS and hostname.
/// - Storage: As many VolumeClaims as requested.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
/// The StatefulSet guarantees that a given network identity will always map to the same storage identity.
///
/// This resource waits until its status is ready before registering success
/// for create/update, and populating output properties from the current state of the resource.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Batch/V1/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Pulumi.Kubernetes.Batch.V1
/// 2. The Job's '.status.conditions' has a status of type 'Complete', and a 'status' set
/// to 'True'.
/// 3. The Job's '.status.conditions' do not have a status of type 'Failed', with a
/// 'status' set to 'True'. If this condition is set, we should fail the Job immediately.
/// 'status' set to 'True'. If this condition is set, we should fail the Job immediately.
///
/// If the Job has not reached a Ready state after 10 minutes, it will
/// time out and mark the resource update as Failed. You can override the default timeout value
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Core/V1/Pod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Pulumi.Kubernetes.Core.V1
/// 2. The Pod is initialized ("Initialized" '.status.condition' is true).
/// 3. The Pod is ready ("Ready" '.status.condition' is true) and the '.status.phase' is
/// set to "Running".
/// Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").
/// Or (for Jobs): The Pod succeeded ('.status.phase' set to "Succeeded").
///
/// If the Pod has not reached a Ready state after 10 minutes, it will
/// time out and mark the resource update as Failed. You can override the default timeout value
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Core/V1/Secret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Pulumi.Kubernetes.Core.V1
/// Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.
///
/// Note: While Pulumi automatically encrypts the 'data' and 'stringData'
/// fields, this encryption only applies to Pulumi's context, including the state file,
/// fields, this encryption only applies to Pulumi's context, including the state file,
/// the Service, the CLI, etc. Kubernetes does not encrypt Secret resources by default,
/// and the contents are visible to users with access to the Secret in Kubernetes using
/// tools like 'kubectl'.
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Core/V1/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Pulumi.Kubernetes.Core.V1
/// an "empty headless" Service [1] or a Service with '.spec.type: ExternalName').
/// 4. External IP address is allocated (if Service has '.spec.type: LoadBalancer').
///
/// Known limitations:
/// Known limitations:
/// Services targeting ReplicaSets (and, by extension, Deployments,
/// StatefulSets, etc.) with '.spec.replicas' set to 0 are not handled, and will time
/// out. To work around this limitation, set 'pulumi.com/skipAwait: "true"' on
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Extensions/V1Beta1/Ingress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Pulumi.Kubernetes.Extensions.V1Beta1
{
/// <summary>
/// Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
/// Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
///
/// This resource waits until its status is ready before registering success
/// for create/update, and populating output properties from the current state of the resource.
Expand Down
3 changes: 3 additions & 0 deletions sdk/dotnet/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ public sealed class ProviderArgs : Pulumi.ResourceArgs

public ProviderArgs()
{
EnableDryRun = Utilities.GetEnvBoolean("PULUMI_K8S_ENABLE_DRY_RUN");
KubeConfig = Utilities.GetEnv("KUBECONFIG");
SuppressDeprecationWarnings = Utilities.GetEnvBoolean("PULUMI_K8S_SUPPRESS_DEPRECATION_WARNINGS");
}
}
}
Loading