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

Add tags to application resource and datasource #38243

Merged
Prev Previous commit
Next Next commit
Fix tags in datasource
  • Loading branch information
drewtul committed Dec 6, 2024

Verified

This commit was signed with the committer’s verified signature.
addaleax Anna Henningsen
commit c72091c1e7edceb8673efa7523e691f2d2f94b26
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ func (d *dataSourceApplication) Schema(ctx context.Context, req datasource.Schem
}
func (d *dataSourceApplication) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) {
conn := d.Meta().ServiceCatalogAppRegistryClient(ctx)
ignoreTagsConfig := d.Meta().IgnoreTagsConfig

var data dataSourceApplicationData
resp.Diagnostics.Append(req.Config.Get(ctx, &data)...)
@@ -74,7 +75,10 @@ func (d *dataSourceApplication) Read(ctx context.Context, req datasource.ReadReq
}

resp.Diagnostics.Append(flex.Flatten(ctx, out, &data)...)
setTagsOut(ctx, out.Tags)

// Transparent tagging doesn't work for DataSource yet
data.Tags = flex.FlattenFrameworkStringValueMapLegacy(ctx, KeyValueTags(ctx, out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map())

resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
}