-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for metadata.generateName (CSA) (#2808)
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md) for Pulumi's contribution guidelines. Help us merge your changes more quickly by adding more details such as labels, milestones, and reviewers.--> ### Proposed changes <!--Give us a brief description of what you've done and what it solves. --> This PR implements support for `.metadata.generateName` in CSA mode, based on #2790. 1. Adjust the auto-naming logic to consider `.metadata.generateName` to be a variant of auto-naming. Pulumi will not assign an auto-name to a new resource that has `generateName`, and upon delete will use the replace-then-delete technique. 2. Use outputs rather than inputs to fetch the live object or to obtain the live object's name. 3. Fix an autonaming bug where the old auto-name would erroneously be adopted, overwriting a new computed name. ### Tests 1. A new integration test is provided to test the use of `metadata.generateName`. It tests creation, update, replacement, and promotion from `.generateName` to `.name`. ([ref](https://github.com/pulumi/pulumi-kubernetes/pull/2808/files#diff-7e85ce707283b1d281d971a8e5b0c49b959b0803ba3437dc9dbd422552326835R269)) 2. New test cases for the await logic. 3. The existing autonaming test is enhanced to test how autonaming takes precedence over `generateName`, in the update case. This is to ensure backwards compatibility, e.g. in the edge case that an existing object has a `generateName` field (which Pulumi ignored until now). ### Related issues (optional) Closes #2539
- Loading branch information
1 parent
33c84f9
commit cc3c25d
Showing
22 changed files
with
677 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.