Skip to content

Commit

Permalink
Revert "'InContext.TagsIn' is 'Option[KeyValueTags]'."
Browse files Browse the repository at this point in the history
This reverts commit 258b3bf.
  • Loading branch information
ewbankkit committed Mar 27, 2023
1 parent cf6058c commit 0250103
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/provider/fwprovider/intercept.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ func (r tagsInterceptor) create(ctx context.Context, request resource.CreateRequ
// Remove system tags.
tags = tags.IgnoreAWS()

tagsInContext.TagsIn = types.Some(tags)
tagsInContext.TagsIn = tags
case After:
// Set values for unknowns.
// Remove any provider configured ignore_tags and system tags from those passed to the service API.
// Computed tags_all include any provider configured default_tags.
stateTagsAll := flex.FlattenFrameworkStringValueMapLegacy(ctx, tagsInContext.TagsIn.UnwrapOrDefault().IgnoreAWS().IgnoreConfig(tagsInContext.IgnoreConfig).Map())
stateTagsAll := flex.FlattenFrameworkStringValueMapLegacy(ctx, tagsInContext.TagsIn.IgnoreAWS().IgnoreConfig(tagsInContext.IgnoreConfig).Map())
diags.Append(response.State.SetAttribute(ctx, path.Root(names.AttrTagsAll), &stateTagsAll)...)

if diags.HasError() {
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/intercept.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (r tagsInterceptor) run(ctx context.Context, d *schema.ResourceData, meta a
// Remove system tags.
tags = tags.IgnoreAWS()

tagsInContext.TagsIn = types.Some(tags)
tagsInContext.TagsIn = tags
case Update:
// If the service package has a generic resource update tags methods, call it.
if v, ok := sp.(interface {
Expand Down
4 changes: 1 addition & 3 deletions internal/tags/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type InContext struct {
DefaultConfig *DefaultConfig
IgnoreConfig *IgnoreConfig
// TagsIn holds tags specified in configuration. Typically this field includes any default tags and excludes system tags.
TagsIn types.Option[KeyValueTags]
TagsIn KeyValueTags
// TagsOut holds tags returned from AWS, including any ignored or system tags.
TagsOut types.Option[KeyValueTags]
}
Expand All @@ -21,8 +21,6 @@ func NewContext(ctx context.Context, defaultConfig *DefaultConfig, ignoreConfig
v := InContext{
DefaultConfig: defaultConfig,
IgnoreConfig: ignoreConfig,
TagsIn: types.None[KeyValueTags](),
TagsOut: types.None[KeyValueTags](),
}

return context.WithValue(ctx, tagKey, &v)
Expand Down

0 comments on commit 0250103

Please sign in to comment.