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

Qualify Pulumi.Resource type to stay out of the way of the resource API in K8s v1.26.0 #2237

Merged
merged 3 commits into from
Nov 22, 2022
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## Unreleased

- Add allowNullValues boolean option to pass Null values through helm configs without having them scrubbed (https://github.com/pulumi/pulumi-kubernetes/issues/2089)
- For SSA conflicts, add a note to the error message about how to resolve (https://github.com/pulumi/pulumi-kubernetes/issues/2235)
- Add allowNullValues boolean option to pass Null values through helm configs without having them
scrubbed (https://github.com/pulumi/pulumi-kubernetes/issues/2089)
- For SSA conflicts, add a note to the error message about how to resolve
(https://github.com/pulumi/pulumi-kubernetes/issues/2235)
- Make room for the `resource` API in Kubernetes 1.26.0 by qualifying the type of the same name in
.NET code templates (https://github.com/pulumi/pulumi-kubernetes/pull/2237)

## 3.22.1 (October 26, 2022)

Expand Down
6 changes: 3 additions & 3 deletions provider/pkg/gen/dotnet-templates/helm/ChartBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Text.Json;
using Pulumi;
using Pu = Pulumi;
using Pulumi.Kubernetes.Yaml;
using Pulumi.Utilities;

Expand Down Expand Up @@ -260,8 +260,8 @@ private void Fetch(string chart, ChartFetchArgsUnwrap opts)
}

private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(string text,
List<TransformationAction> transformations, string? resourcePrefix, ImmutableHashSet<Resource> dependsOn,
string? defaultNamespace, Pulumi.ProviderResource provider)
List<TransformationAction> transformations, string? resourcePrefix, ImmutableHashSet<Pu.Resource> dependsOn,
string? defaultNamespace, Pu.ProviderResource provider)
{
return Yaml.Invokes
.YamlDecode(new YamlDecodeArgs { Text = text, DefaultNamespace = defaultNamespace }, new InvokeOptions { Provider = provider })
Expand Down
3 changes: 2 additions & 1 deletion provider/pkg/gen/dotnet-templates/helm/v3/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Text.Json.Serialization;
using Pulumi.Kubernetes.Yaml;
using Pulumi.Utilities;
using Pu = Pulumi;

namespace Pulumi.Kubernetes.Helm.V3
{
Expand Down Expand Up @@ -289,7 +290,7 @@ private static string GetName(Union<ChartArgs, LocalChartArgs> config, string re
return string.IsNullOrEmpty(prefix) ? releaseName : $"{prefix}-{releaseName}";
}

private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(Union<ChartArgsUnwrap, LocalChartArgsUnwrap> args, string releaseName, ImmutableHashSet<Resource> dependsOn, ComponentResourceOptions? options)
private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(Union<ChartArgsUnwrap, LocalChartArgsUnwrap> args, string releaseName, ImmutableHashSet<Pu.Resource> dependsOn, ComponentResourceOptions? options)
{
// Build JSON args to Helm provider invoke.
var serializeOptions = new JsonSerializerOptions
Expand Down
7 changes: 4 additions & 3 deletions provider/pkg/gen/dotnet-templates/yaml/yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ using System.IO;
using System.Linq;
using System.Text.Json;
using GlobExpressions;
using Pu = Pulumi;

#pragma warning disable CS0618

Expand Down Expand Up @@ -82,9 +83,9 @@ namespace Pulumi.Kubernetes.Yaml
/// <summary>
/// Returns an array of ready resources to be used by DependsOn.
/// </summary>
public Output<ImmutableArray<Resource>> Ready()
public Output<ImmutableArray<Pu.Resource>> Ready()
{
return Resources.Apply(resources => resources.Values.Cast<Resource>().ToImmutableArray());
return Resources.Apply(resources => resources.Values.Cast<Pu.Resource>().ToImmutableArray());
}

/// <summary>
Expand Down Expand Up @@ -233,7 +234,7 @@ namespace Pulumi.Kubernetes.Yaml
var opts = new CustomResourceOptions
{
Parent = options?.Parent,
DependsOn = options?.DependsOn ?? new InputList<Resource>(),
DependsOn = options?.DependsOn ?? new InputList<Pu.Resource>(),
IgnoreChanges = options?.IgnoreChanges ?? new List<string>(),
Version = options?.Version,
Provider = options?.Provider,
Expand Down
6 changes: 3 additions & 3 deletions sdk/dotnet/Helm/ChartBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using System.Text;
using System.Text.RegularExpressions;
using System.Text.Json;
using Pulumi;
using Pu = Pulumi;
using Pulumi.Kubernetes.Yaml;
using Pulumi.Utilities;

Expand Down Expand Up @@ -260,8 +260,8 @@ private void Fetch(string chart, ChartFetchArgsUnwrap opts)
}

private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(string text,
List<TransformationAction> transformations, string? resourcePrefix, ImmutableHashSet<Resource> dependsOn,
string? defaultNamespace, Pulumi.ProviderResource provider)
List<TransformationAction> transformations, string? resourcePrefix, ImmutableHashSet<Pu.Resource> dependsOn,
string? defaultNamespace, Pu.ProviderResource provider)
{
return Yaml.Invokes
.YamlDecode(new YamlDecodeArgs { Text = text, DefaultNamespace = defaultNamespace }, new InvokeOptions { Provider = provider })
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/Helm/V3/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Text.Json.Serialization;
using Pulumi.Kubernetes.Yaml;
using Pulumi.Utilities;
using Pu = Pulumi;

namespace Pulumi.Kubernetes.Helm.V3
{
Expand Down Expand Up @@ -289,7 +290,7 @@ private static string GetName(Union<ChartArgs, LocalChartArgs> config, string re
return string.IsNullOrEmpty(prefix) ? releaseName : $"{prefix}-{releaseName}";
}

private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(Union<ChartArgsUnwrap, LocalChartArgsUnwrap> args, string releaseName, ImmutableHashSet<Resource> dependsOn, ComponentResourceOptions? options)
private Output<ImmutableDictionary<string, KubernetesResource>> ParseTemplate(Union<ChartArgsUnwrap, LocalChartArgsUnwrap> args, string releaseName, ImmutableHashSet<Pu.Resource> dependsOn, ComponentResourceOptions? options)
{
// Build JSON args to Helm provider invoke.
var serializeOptions = new JsonSerializerOptions
Expand Down
7 changes: 4 additions & 3 deletions sdk/dotnet/Yaml/Yaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using System.Linq;
using System.Text.Json;
using GlobExpressions;
using Pu = Pulumi;

#pragma warning disable CS0618

Expand Down Expand Up @@ -740,9 +741,9 @@ public Output<T> GetResource<T>(string name, string? namespaceName = null)
/// <summary>
/// Returns an array of ready resources to be used by DependsOn.
/// </summary>
public Output<ImmutableArray<Resource>> Ready()
public Output<ImmutableArray<Pu.Resource>> Ready()
{
return Resources.Apply(resources => resources.Values.Cast<Resource>().ToImmutableArray());
return Resources.Apply(resources => resources.Values.Cast<Pu.Resource>().ToImmutableArray());
}

/// <summary>
Expand Down Expand Up @@ -891,7 +892,7 @@ internal static Output<ImmutableDictionary<string, KubernetesResource>> ParseYam
var opts = new CustomResourceOptions
{
Parent = options?.Parent,
DependsOn = options?.DependsOn ?? new InputList<Resource>(),
DependsOn = options?.DependsOn ?? new InputList<Pu.Resource>(),
IgnoreChanges = options?.IgnoreChanges ?? new List<string>(),
Version = options?.Version,
Provider = options?.Provider,
Expand Down