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

Fix import resources with provider default tags #4169

Merged
merged 18 commits into from
Jul 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add a note
  • Loading branch information
corymhall committed Jul 10, 2024
commit e24dbfa787cf6997cf32db7e1e4f1fb9ce81c840
3 changes: 3 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -5946,6 +5946,9 @@ compatibility shim in favor of the new "name" field.`)
}

// also override read so that it works during import
// as a side effect this will also run during create and update, but since
// `tags` and `defaultTags` should always be equal then it doesn't really matter.
// One extra place that we make sure `tags=defaultTags` is fine.
if transform := prov.Resources[key].TransformOutputs; transform != nil {
prov.Resources[key].TransformOutputs = func(ctx context.Context, pm resource.PropertyMap) (resource.PropertyMap, error) {
config, err := transform(ctx, pm)
Expand Down
Loading