Skip to content

Commit

Permalink
Make allowNullValues an InputProperty (#2255)
Browse files Browse the repository at this point in the history
adds allowNullValues to the resource schema InputProperties and rebuilds SDKs to expose the argument so that it can be set with the SDKs
  • Loading branch information
cdibble committed Dec 7, 2022
1 parent 5b13d1d commit 8a8d523
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

- Expose the allowNullValues boolean as an InputProperty so that it can be set in SDKs (https://github.com/pulumi/pulumi-kubernetes/pulls/2255)

## 3.22.2 (November 30, 2022)

- Add allowNullValues boolean option to pass Null values through helm configs without having them
Expand Down
4 changes: 4 additions & 0 deletions provider/cmd/pulumi-resource-kubernetes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73590,6 +73590,10 @@
}
},
"inputProperties": {
"allowNullValues": {
"type": "boolean",
"description": "Whether to allow Null values in helm chart configs."
},
"atomic": {
"type": "boolean",
"description": "If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used."
Expand Down
6 changes: 6 additions & 0 deletions provider/pkg/gen/overlays.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,12 @@ var helmV3ReleaseResource = pschema.ResourceSpec{
},
Const: "true",
},
"allowNullValues": {
TypeSpec: pschema.TypeSpec{
Type: "boolean",
},
Description: "Whether to allow Null values in helm chart configs.",
},
},
RequiredInputs: []string{
"chart",
Expand Down
6 changes: 6 additions & 0 deletions sdk/dotnet/Helm/V3/Release.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ namespace Pulumi.Kubernetes.Types.Inputs.Helm.V3

public class ReleaseArgs : global::Pulumi.ResourceArgs
{
/// <summary>
/// Whether to allow Null values in helm chart configs.
/// </summary>
[Input("allowNullValues")]
public Input<bool>? AllowNullValues { get; set; }

/// <summary>
/// If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions sdk/go/kubernetes/helm/v3/release.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ public final class ReleaseArgs extends com.pulumi.resources.ResourceArgs {

public static final ReleaseArgs Empty = new ReleaseArgs();

/**
* Whether to allow Null values in helm chart configs.
*
*/
@Import(name="allowNullValues")
private @Nullable Output<Boolean> allowNullValues;

/**
* @return Whether to allow Null values in helm chart configs.
*
*/
public Optional<Output<Boolean>> allowNullValues() {
return Optional.ofNullable(this.allowNullValues);
}

/**
* If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
*
Expand Down Expand Up @@ -528,6 +543,7 @@ public Optional<Output<Boolean>> waitForJobs() {
private ReleaseArgs() {}

private ReleaseArgs(ReleaseArgs $) {
this.allowNullValues = $.allowNullValues;
this.atomic = $.atomic;
this.chart = $.chart;
this.cleanupOnFail = $.cleanupOnFail;
Expand Down Expand Up @@ -582,6 +598,27 @@ public Builder(ReleaseArgs defaults) {
$ = new ReleaseArgs(Objects.requireNonNull(defaults));
}

/**
* @param allowNullValues Whether to allow Null values in helm chart configs.
*
* @return builder
*
*/
public Builder allowNullValues(@Nullable Output<Boolean> allowNullValues) {
$.allowNullValues = allowNullValues;
return this;
}

/**
* @param allowNullValues Whether to allow Null values in helm chart configs.
*
* @return builder
*
*/
public Builder allowNullValues(Boolean allowNullValues) {
return allowNullValues(Output.of(allowNullValues));
}

/**
* @param atomic If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
*
Expand Down
8 changes: 6 additions & 2 deletions sdk/nodejs/helm/v3/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class Release extends pulumi.CustomResource {
/**
* Whether to allow Null values in helm chart configs.
*/
public /*out*/ readonly allowNullValues!: pulumi.Output<boolean>;
public readonly allowNullValues!: pulumi.Output<boolean>;
/**
* If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
*/
Expand Down Expand Up @@ -340,6 +340,7 @@ export class Release extends pulumi.CustomResource {
if ((!args || args.chart === undefined) && !opts.urn) {
throw new Error("Missing required property 'chart'");
}
resourceInputs["allowNullValues"] = args ? args.allowNullValues : undefined;
resourceInputs["atomic"] = args ? args.atomic : undefined;
resourceInputs["chart"] = args ? args.chart : undefined;
resourceInputs["cleanupOnFail"] = args ? args.cleanupOnFail : undefined;
Expand Down Expand Up @@ -374,7 +375,6 @@ export class Release extends pulumi.CustomResource {
resourceInputs["verify"] = args ? args.verify : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["waitForJobs"] = args ? args.waitForJobs : undefined;
resourceInputs["allowNullValues"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
} else {
resourceInputs["allowNullValues"] = undefined /*out*/;
Expand Down Expand Up @@ -422,6 +422,10 @@ export class Release extends pulumi.CustomResource {
* The set of arguments for constructing a Release resource.
*/
export interface ReleaseArgs {
/**
* Whether to allow Null values in helm chart configs.
*/
allowNullValues?: pulumi.Input<boolean>;
/**
* If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
*/
Expand Down
21 changes: 20 additions & 1 deletion sdk/python/pulumi_kubernetes/helm/v3/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class ReleaseArgs:
def __init__(__self__, *,
chart: pulumi.Input[str],
allow_null_values: Optional[pulumi.Input[bool]] = None,
atomic: Optional[pulumi.Input[bool]] = None,
cleanup_on_fail: Optional[pulumi.Input[bool]] = None,
compat: Optional[pulumi.Input[str]] = None,
Expand Down Expand Up @@ -53,6 +54,7 @@ def __init__(__self__, *,
"""
The set of arguments for constructing a Release resource.
:param pulumi.Input[str] chart: Chart name to be installed. A path may be used.
:param pulumi.Input[bool] allow_null_values: Whether to allow Null values in helm chart configs.
:param pulumi.Input[bool] atomic: If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
:param pulumi.Input[bool] cleanup_on_fail: Allow deletion of new resources created in this upgrade when upgrade fails.
:param pulumi.Input[bool] create_namespace: Create the namespace if it does not exist.
Expand Down Expand Up @@ -87,6 +89,8 @@ def __init__(__self__, *,
:param pulumi.Input[bool] wait_for_jobs: Will wait until all Jobs have been completed before marking the release as successful. This is ignored if `skipAwait` is enabled.
"""
pulumi.set(__self__, "chart", chart)
if allow_null_values is not None:
pulumi.set(__self__, "allow_null_values", allow_null_values)
if atomic is not None:
pulumi.set(__self__, "atomic", atomic)
if cleanup_on_fail is not None:
Expand Down Expand Up @@ -166,6 +170,18 @@ def chart(self) -> pulumi.Input[str]:
def chart(self, value: pulumi.Input[str]):
pulumi.set(self, "chart", value)

@property
@pulumi.getter(name="allowNullValues")
def allow_null_values(self) -> Optional[pulumi.Input[bool]]:
"""
Whether to allow Null values in helm chart configs.
"""
return pulumi.get(self, "allow_null_values")

@allow_null_values.setter
def allow_null_values(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "allow_null_values", value)

@property
@pulumi.getter
def atomic(self) -> Optional[pulumi.Input[bool]]:
Expand Down Expand Up @@ -565,6 +581,7 @@ class Release(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
allow_null_values: Optional[pulumi.Input[bool]] = None,
atomic: Optional[pulumi.Input[bool]] = None,
chart: Optional[pulumi.Input[str]] = None,
cleanup_on_fail: Optional[pulumi.Input[bool]] = None,
Expand Down Expand Up @@ -765,6 +782,7 @@ def __init__(__self__,
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[bool] allow_null_values: Whether to allow Null values in helm chart configs.
:param pulumi.Input[bool] atomic: If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
:param pulumi.Input[str] chart: Chart name to be installed. A path may be used.
:param pulumi.Input[bool] cleanup_on_fail: Allow deletion of new resources created in this upgrade when upgrade fails.
Expand Down Expand Up @@ -983,6 +1001,7 @@ def __init__(__self__, resource_name: str, *args, **kwargs):
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
allow_null_values: Optional[pulumi.Input[bool]] = None,
atomic: Optional[pulumi.Input[bool]] = None,
chart: Optional[pulumi.Input[str]] = None,
cleanup_on_fail: Optional[pulumi.Input[bool]] = None,
Expand Down Expand Up @@ -1026,6 +1045,7 @@ def _internal_init(__self__,
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = ReleaseArgs.__new__(ReleaseArgs)

__props__.__dict__["allow_null_values"] = allow_null_values
__props__.__dict__["atomic"] = atomic
if chart is None and not opts.urn:
raise TypeError("Missing required property 'chart'")
Expand Down Expand Up @@ -1062,7 +1082,6 @@ def _internal_init(__self__,
__props__.__dict__["verify"] = verify
__props__.__dict__["version"] = version
__props__.__dict__["wait_for_jobs"] = wait_for_jobs
__props__.__dict__["allow_null_values"] = None
__props__.__dict__["status"] = None
super(Release, __self__).__init__(
'kubernetes:helm.sh/v3:Release',
Expand Down

0 comments on commit 8a8d523

Please sign in to comment.