-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix import resources with provider default tags (#4169)
We have special logic around applying default provider tags to resources. This logic only applied to the `Check` call which means it was not applied when you were importing resources. This PR extends that logic to also run during the `Read` call by utilizing `TransformOutputs`. While it is true that `TransformOutputs` also runs during `Create` & `Update` this is a side effect that I think is ok. From my understanding `tags` and `tagsAll` should always be equal. If we have an additional place where we make sure they are equal it shouldn't harm anything. I've added tests (see `testTagsPulumiLifecycle`) which test the complete lifecycle of a pulumi program 1. `Up` with both provider `defaultTags`/`ignoreTags` and resource level `tags` 1a. Run validations on result 2. `Refresh` with no changes 3. `Import` using the resource option. Ensures resource can be successfully imported 3a. Allows for a hook to be run prior to import being run. e.g. Add tags remotely 4. `Import` using the CLI. Ensures resources can be successfully imported 4a. Allows for a hook to be run prior to import being run. e.g. Add tags remotely 5. `Refresh` with no changes fix #4030, fix #4080, fix #3311
- Loading branch information
Showing
12 changed files
with
899 additions
and
48 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
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.