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

[sdk/ts] Update CustomResource to match current codegen #1510

Merged
merged 1 commit into from
Mar 29, 2021
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
@@ -1,6 +1,7 @@
## HEAD (Unreleased)

- Ensure using `PULUMI_KUBERNETES_MANAGED_BY_LABEL` doesn't cause diffs on further stack updates (https://github.com/pulumi/pulumi-kubernetes/pull/1508)
- [sdk/ts] Update CustomResource to match current codegen (https://github.com/pulumi/pulumi-kubernetes/pull/1510)

## 2.8.3 (March 17, 2021)

Expand Down
23 changes: 13 additions & 10 deletions provider/pkg/gen/nodejs-templates/apiextensions/customResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import * as pulumi from "@pulumi/pulumi"
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import { getVersion } from "../utilities";
import * as utilities from "../utilities";

/**
* CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the
Expand Down Expand Up @@ -74,18 +74,21 @@ export class CustomResource extends pulumi.CustomResource {
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: CustomResourceArgs, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};
for (const key of Object.keys(args)) {
props[key] = (args as any)[key];
}

if (!opts) {
opts = {}
let inputs: pulumi.Inputs = {};
opts = opts || {};
if (!opts.id) {
for (const key of Object.keys(args)) {
inputs[key] = (args as any)[key];
}
} else {
for (const key of Object.keys(args)) {
inputs[key] = undefined;
}
}
if (!opts.version) {
opts.version = getVersion();
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
}
super(`kubernetes:${args.apiVersion}:${args.kind}`, name, props, opts);
super(`kubernetes:${args.apiVersion}:${args.kind}`, name, inputs, opts);
this.__inputs = args;
}
}
Expand Down
23 changes: 13 additions & 10 deletions sdk/nodejs/apiextensions/customResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import * as pulumi from "@pulumi/pulumi"
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import { getVersion } from "../utilities";
import * as utilities from "../utilities";

/**
* CustomResource represents an instance of a CustomResourceDefinition (CRD). For example, the
Expand Down Expand Up @@ -74,18 +74,21 @@ export class CustomResource extends pulumi.CustomResource {
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: CustomResourceArgs, opts?: pulumi.CustomResourceOptions) {
const props: pulumi.Inputs = {};
for (const key of Object.keys(args)) {
props[key] = (args as any)[key];
}

if (!opts) {
opts = {}
let inputs: pulumi.Inputs = {};
opts = opts || {};
if (!opts.id) {
for (const key of Object.keys(args)) {
inputs[key] = (args as any)[key];
}
} else {
for (const key of Object.keys(args)) {
inputs[key] = undefined;
}
}
if (!opts.version) {
opts.version = getVersion();
opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
}
super(`kubernetes:${args.apiVersion}:${args.kind}`, name, props, opts);
super(`kubernetes:${args.apiVersion}:${args.kind}`, name, inputs, opts);
this.__inputs = args;
}
}
Expand Down