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

[codegen/go] Fix secret codegen for input properties #9052

Merged
merged 4 commits into from
Feb 26, 2022

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Feb 25, 2022

Description

#7128 added code to mark properties as secret based on a schema flag, but did not correctly handle the case where output properties do not have a corresponding input property. In this case, code was generated for nonexistent input properties, and would lead to a panic.

Fixes #8967

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

#7128 added code to mark properties as secret based on a schema flag, but did not correctly handle the case where output properties do not have a corresponding input property. In this case, code was generated for nonexistent input properties, and would lead to a panic.
@github-actions
Copy link

Diff for pulumi-random with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-azuread with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-gcp with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-azure with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-aws with merge commit 53a61dd

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit 53a61dd

@lblackstone lblackstone marked this pull request as ready for review February 25, 2022 23:03
@github-actions
Copy link

Diff for pulumi-random with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-azuread with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-gcp with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-azure with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-aws with merge commit a1c62e8

Copy link
Member

@justinvp justinvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

CHANGELOG_PENDING.md Outdated Show resolved Hide resolved
pkg/codegen/go/gen.go Outdated Show resolved Hide resolved
@@ -27,9 +27,6 @@ func NewCat(ctx *pulumi.Context,
args = &CatArgs{}
}

if args.Name != nil {
args.Name = pulumi.ToSecret(args.Name).(pulumi.StringPtrOutput)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we can delete the SkipCompileCheck for Go for this test now?

SkipCompileCheck: codegen.NewStringSet(golang),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, perhaps. I'll give it a shot.

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit a1c62e8

@github-actions
Copy link

Diff for pulumi-random with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-azuread with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-gcp with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-azure with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-aws with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit c6cbaeb

@github-actions
Copy link

Diff for pulumi-random with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-azuread with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-kubernetes with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-gcp with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-azure with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-aws with merge commit cec12cc

@github-actions
Copy link

Diff for pulumi-azure-native with merge commit cec12cc

@lblackstone lblackstone merged commit 301efa6 into master Feb 26, 2022
@pulumi-bot pulumi-bot deleted the lblackstone/go-codegen branch February 26, 2022 22:26
frezbo added a commit to pulumiverse/pulumi-talos that referenced this pull request Feb 27, 2022
Pulls in fixes from pulumi/pulumi#9052

Signed-off-by: Noel Georgi <git@frezbo.dev>
AaronFriel added a commit that referenced this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[codegen/go] Secret outputs not generated correctly
2 participants