Skip to content

Commit

Permalink
Fix array output property typing for .NET (#931)
Browse files Browse the repository at this point in the history
We were typing these as Output<T[]>, but the .NET deserialization only supports Output<ImmutableArray<T>>.

Fixes #926.
  • Loading branch information
Luke Hoban authored Dec 20, 2019
1 parent c3ed54c commit 0139d36
Show file tree
Hide file tree
Showing 113 changed files with 159 additions and 116 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## HEAD (Unreleased)

- Fix projection of array-valued output properties in .NET. (https://github.com/pulumi/pulumi-kubernetes/pull/931)

## 1.4.1 (December 17, 2019)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions pkg/gen/typegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ func makeDotnetType(resourceType, propName string, prop map[string]interface{},
switch gentype {
case provider:
elemType := makeDotnetType(
resourceType, propName, prop["items"].(map[string]interface{}), gentype, forceNoWrap)
return fmt.Sprintf("%s[]>", elemType[:len(elemType)-1])
resourceType, propName, prop["items"].(map[string]interface{}), gentype, true)
return fmt.Sprintf("Output<ImmutableArray<%s>>", elemType)
case outputsAPI:
elemType := makeDotnetType(
resourceType, propName, prop["items"].(map[string]interface{}), gentype, forceNoWrap)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public partial class MutatingWebhookConfiguration : Pulumi.CustomResource
/// Webhooks is a list of webhooks and the affected resources and operations.
/// </summary>
[Output("webhooks")]
public Output<Types.Outputs.AdmissionRegistration.V1.MutatingWebhook[]> Webhooks { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1.MutatingWebhook>> Webhooks { get; private set; } = null!;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class MutatingWebhookConfigurationList : Pulumi.CustomResource
/// List of MutatingWebhookConfiguration.
/// </summary>
[Output("items")]
public Output<Types.Outputs.AdmissionRegistration.V1.MutatingWebhookConfiguration[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1.MutatingWebhookConfiguration>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public partial class ValidatingWebhookConfiguration : Pulumi.CustomResource
/// Webhooks is a list of webhooks and the affected resources and operations.
/// </summary>
[Output("webhooks")]
public Output<Types.Outputs.AdmissionRegistration.V1.ValidatingWebhook[]> Webhooks { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1.ValidatingWebhook>> Webhooks { get; private set; } = null!;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ValidatingWebhookConfigurationList : Pulumi.CustomResource
/// List of ValidatingWebhookConfiguration.
/// </summary>
[Output("items")]
public Output<Types.Outputs.AdmissionRegistration.V1.ValidatingWebhookConfiguration[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1.ValidatingWebhookConfiguration>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public partial class MutatingWebhookConfiguration : Pulumi.CustomResource
/// Webhooks is a list of webhooks and the affected resources and operations.
/// </summary>
[Output("webhooks")]
public Output<Types.Outputs.AdmissionRegistration.V1Beta1.MutatingWebhook[]> Webhooks { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1Beta1.MutatingWebhook>> Webhooks { get; private set; } = null!;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class MutatingWebhookConfigurationList : Pulumi.CustomResource
/// List of MutatingWebhookConfiguration.
/// </summary>
[Output("items")]
public Output<Types.Outputs.AdmissionRegistration.V1Beta1.MutatingWebhookConfiguration[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1Beta1.MutatingWebhookConfiguration>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public partial class ValidatingWebhookConfiguration : Pulumi.CustomResource
/// Webhooks is a list of webhooks and the affected resources and operations.
/// </summary>
[Output("webhooks")]
public Output<Types.Outputs.AdmissionRegistration.V1Beta1.ValidatingWebhook[]> Webhooks { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1Beta1.ValidatingWebhook>> Webhooks { get; private set; } = null!;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ValidatingWebhookConfigurationList : Pulumi.CustomResource
/// List of ValidatingWebhookConfiguration.
/// </summary>
[Output("items")]
public Output<Types.Outputs.AdmissionRegistration.V1Beta1.ValidatingWebhookConfiguration[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AdmissionRegistration.V1Beta1.ValidatingWebhookConfiguration>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CustomResourceDefinitionList : Pulumi.CustomResource
/// items list individual CustomResourceDefinition objects
/// </summary>
[Output("items")]
public Output<Types.Outputs.ApiExtensions.V1.CustomResourceDefinition[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.ApiExtensions.V1.CustomResourceDefinition>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CustomResourceDefinitionList : Pulumi.CustomResource
/// items list individual CustomResourceDefinition objects
/// </summary>
[Output("items")]
public Output<Types.Outputs.ApiExtensions.V1Beta1.CustomResourceDefinition[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.ApiExtensions.V1Beta1.CustomResourceDefinition>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/ApiRegistration/V1/APIServiceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class APIServiceList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.ApiRegistration.V1.APIService[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.ApiRegistration.V1.APIService>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/ApiRegistration/V1Beta1/APIServiceList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class APIServiceList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.ApiRegistration.V1Beta1.APIService[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.ApiRegistration.V1Beta1.APIService>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/ControllerRevisionList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ControllerRevisionList : Pulumi.CustomResource
/// Items is the list of ControllerRevisions
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1.ControllerRevision[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1.ControllerRevision>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/DaemonSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class DaemonSetList : Pulumi.CustomResource
/// A list of daemon sets.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1.DaemonSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1.DaemonSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/DeploymentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class DeploymentList : Pulumi.CustomResource
/// Items is the list of Deployments.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1.Deployment[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1.Deployment>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/ReplicaSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class ReplicaSetList : Pulumi.CustomResource
/// https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1.ReplicaSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1.ReplicaSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1/StatefulSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class StatefulSetList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.Apps.V1.StatefulSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1.StatefulSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta1/ControllerRevisionList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ControllerRevisionList : Pulumi.CustomResource
/// Items is the list of ControllerRevisions
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta1.ControllerRevision[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta1.ControllerRevision>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta1/DeploymentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class DeploymentList : Pulumi.CustomResource
/// Items is the list of Deployments.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta1.Deployment[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta1.Deployment>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta1/StatefulSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class StatefulSetList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.Apps.V1Beta1.StatefulSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta1.StatefulSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/ControllerRevisionList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ControllerRevisionList : Pulumi.CustomResource
/// Items is the list of ControllerRevisions
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta2.ControllerRevision[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta2.ControllerRevision>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/DaemonSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class DaemonSetList : Pulumi.CustomResource
/// A list of daemon sets.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta2.DaemonSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta2.DaemonSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/DeploymentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class DeploymentList : Pulumi.CustomResource
/// Items is the list of Deployments.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta2.Deployment[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta2.Deployment>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/ReplicaSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public partial class ReplicaSetList : Pulumi.CustomResource
/// https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
/// </summary>
[Output("items")]
public Output<Types.Outputs.Apps.V1Beta2.ReplicaSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta2.ReplicaSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Apps/V1Beta2/StatefulSetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class StatefulSetList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.Apps.V1Beta2.StatefulSet[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Apps.V1Beta2.StatefulSet>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/AuditRegistraion/V1Alpha1/AuditSinkList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class AuditSinkList : Pulumi.CustomResource
/// List of audit configurations.
/// </summary>
[Output("items")]
public Output<Types.Outputs.AuditRegistraion.V1Alpha1.AuditSink[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.AuditRegistraion.V1Alpha1.AuditSink>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Autoscaling/V1/HorizontalPodAutoscalerList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class HorizontalPodAutoscalerList : Pulumi.CustomResource
/// list of horizontal pod autoscaler objects.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Autoscaling.V1.HorizontalPodAutoscaler[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Autoscaling.V1.HorizontalPodAutoscaler>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class HorizontalPodAutoscalerList : Pulumi.CustomResource
/// items is the list of horizontal pod autoscaler objects.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Autoscaling.V2Beta1.HorizontalPodAutoscaler[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Autoscaling.V2Beta1.HorizontalPodAutoscaler>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class HorizontalPodAutoscalerList : Pulumi.CustomResource
/// items is the list of horizontal pod autoscaler objects.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Autoscaling.V2Beta2.HorizontalPodAutoscaler[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Autoscaling.V2Beta2.HorizontalPodAutoscaler>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Batch/V1/JobList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class JobList : Pulumi.CustomResource
/// items is the list of Jobs.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Batch.V1.Job[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Batch.V1.Job>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Batch/V1Beta1/CronJobList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CronJobList : Pulumi.CustomResource
/// items is the list of CronJobs.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Batch.V1Beta1.CronJob[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Batch.V1Beta1.CronJob>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Batch/V2Alpha1/CronJobList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CronJobList : Pulumi.CustomResource
/// items is the list of CronJobs.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Batch.V2Alpha1.CronJob[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Batch.V2Alpha1.CronJob>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class CertificateSigningRequestList : Pulumi.CustomResource


[Output("items")]
public Output<Types.Outputs.Certificates.V1Beta1.CertificateSigningRequest[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Certificates.V1Beta1.CertificateSigningRequest>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Coordination/V1/LeaseList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class LeaseList : Pulumi.CustomResource
/// Items is a list of schema objects.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Coordination.V1.Lease[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Coordination.V1.Lease>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Coordination/V1Beta1/LeaseList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class LeaseList : Pulumi.CustomResource
/// Items is a list of schema objects.
/// </summary>
[Output("items")]
public Output<Types.Outputs.Coordination.V1Beta1.Lease[]> Items { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Coordination.V1Beta1.Lease>> Items { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Core/V1/ComponentStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class ComponentStatus : Pulumi.CustomResource
/// List of component conditions observed
/// </summary>
[Output("conditions")]
public Output<Types.Outputs.Core.V1.ComponentCondition[]> Conditions { get; private set; } = null!;
public Output<ImmutableArray<Types.Outputs.Core.V1.ComponentCondition>> Conditions { get; private set; } = null!;

/// <summary>
/// Kind is a string value representing the REST resource this object represents. Servers
Expand Down
Loading

0 comments on commit 0139d36

Please sign in to comment.