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

Types for apiVersion, kind, metadata, status should not also accept undefined #34

Closed
metral opened this issue Apr 12, 2021 · 2 comments · Fixed by #143
Closed

Types for apiVersion, kind, metadata, status should not also accept undefined #34

metral opened this issue Apr 12, 2021 · 2 comments · Fixed by #143
Assignees
Labels
area/codegen Affects quality or correctness of generated code kind/enhancement Improvements or new features language/javascript resolution/fixed This issue was fixed

Comments

@metral
Copy link

metral commented Apr 12, 2021

Expected behavior

Typedefs for k8s should not also accept ... | undefined

Current behavior

Currently the generated code produces the following incorrect typedefs:

public readonly apiVersion!: pulumi.Output<"foo/v1" | undefined>;
public readonly kind!: pulumi.Output<"Foo" | undefined>;
public readonly metadata!: pulumi.Output<ObjectMeta | undefined>;
public readonly status!: pulumi.Output<outputs.foo.bar | undefined>;

These need to be corrected to:

public readonly apiVersion!: pulumi.Output<"foo/v1">;
public readonly kind!: pulumi.Output<"Foo">;
public readonly metadata!: pulumi.Output<ObjectMeta>;
public readonly status!: pulumi.Output<outputs.foo.bar>;

See example of a k8s Deployment in pulumi-kubernetes that follows suit with the proposed corrections.


Related:

@metral metral added the kind/bug Some behavior is incorrect or out of spec label Apr 12, 2021
@leezen leezen added kind/bug Some behavior is incorrect or out of spec and removed kind/bug Some behavior is incorrect or out of spec labels Apr 13, 2021
@infin8x infin8x added this to the 0.56 milestone Apr 28, 2021
@leezen leezen removed this from the 0.56 milestone Apr 28, 2021
@mattolenik mattolenik added language/javascript area/codegen Affects quality or correctness of generated code labels Jun 2, 2022
@lukehoban lukehoban added kind/enhancement Improvements or new features and removed kind/bug Some behavior is incorrect or out of spec labels Jul 11, 2022
@cleverguy25
Copy link

@pulumi-bot
Copy link

This issue has been addressed in PR #143 and shipped in release v1.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen Affects quality or correctness of generated code kind/enhancement Improvements or new features language/javascript resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants