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

Remove all patches related to tagsAll #4219

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 9 additions & 7 deletions examples/examples_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ func TestAccDefaultTags(t *testing.T) {
if !ok {
continue
}
v.expected = v.defaultTags
allTags := v.defaultTags
for k, v := range v.tags {
allTags[k] = v
}
v.expected = allTags
steps[i] = v
}

Expand Down Expand Up @@ -267,11 +271,9 @@ func testTags(t *testing.T, dir string, steps []tagsStep) {
Dir: dir,
ExtraRuntimeValidation: editDirs[0].ExtraRuntimeValidation,
EditDirs: editDirs[1:],
// see https://github.com/pulumi/pulumi-aws/issues/4080
ExpectRefreshChanges: true,
Config: map[string]string{"aws:region": getEnvRegion(t)},
Quick: true,
DestroyOnCleanup: true,
Config: map[string]string{"aws:region": getEnvRegion(t)},
Quick: true,
DestroyOnCleanup: true,
})
}

Expand All @@ -288,7 +290,7 @@ resources:
options:
provider: ${aws-provider}
outputs:
actual: ${res.tags}`
actual: ${res.tagsAll}`

var expandMap func(level int, v interface{}) string
expandMap = func(level int, v interface{}) string {
Expand Down
22 changes: 0 additions & 22 deletions patches/0001-Add-TagsSchemaTrulyComputed-definition.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ index 81babf4a9c..92763850ac 100644

diff --git a/internal/service/gamelift/matchmaking_configuration.go b/internal/service/gamelift/matchmaking_configuration.go
new file mode 100644
index 0000000000..0a7c8ea635
index 0000000000..12bf0dd661
--- /dev/null
+++ b/internal/service/gamelift/matchmaking_configuration.go
@@ -0,0 +1,386 @@
Expand Down Expand Up @@ -179,7 +179,7 @@ index 0000000000..0a7c8ea635
+ ),
+ },
+ "tags": tftags.TagsSchema(),
+ "tags_all": tftags.TagsSchemaTrulyComputed(),
+ "tags_all": tftags.TagsSchemaComputed(),
+ },
+ }
+}
Expand Down Expand Up @@ -698,7 +698,7 @@ index 0000000000..94c9a8c29b
+}
diff --git a/internal/service/gamelift/matchmaking_rule_set.go b/internal/service/gamelift/matchmaking_rule_set.go
new file mode 100644
index 0000000000..28d15ecf5e
index 0000000000..5ebbc193dd
--- /dev/null
+++ b/internal/service/gamelift/matchmaking_rule_set.go
@@ -0,0 +1,163 @@
Expand Down Expand Up @@ -756,7 +756,7 @@ index 0000000000..28d15ecf5e
+ Computed: true,
+ },
+ "tags": tftags.TagsSchema(),
+ "tags_all": tftags.TagsSchemaTrulyComputed(),
+ "tags_all": tftags.TagsSchemaComputed(),
+ },
+ }
+}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This PR reverts our patches which will prevent future merge conflicts, and updat
call sites to plumb through the proper Context objects.

diff --git a/internal/service/gamelift/matchmaking_configuration.go b/internal/service/gamelift/matchmaking_configuration.go
index 0a7c8ea635..d8ee20dc65 100644
index 12bf0dd661..707b1c8e2b 100644
--- a/internal/service/gamelift/matchmaking_configuration.go
+++ b/internal/service/gamelift/matchmaking_configuration.go
@@ -2,13 +2,13 @@ package gamelift
Expand Down Expand Up @@ -162,7 +162,7 @@ index 0a7c8ea635..d8ee20dc65 100644

return nil
diff --git a/internal/service/gamelift/matchmaking_rule_set.go b/internal/service/gamelift/matchmaking_rule_set.go
index 28d15ecf5e..8c1189199f 100644
index 5ebbc193dd..f38585f58d 100644
--- a/internal/service/gamelift/matchmaking_rule_set.go
+++ b/internal/service/gamelift/matchmaking_rule_set.go
@@ -2,12 +2,12 @@ package gamelift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Fixup gamelift context


diff --git a/internal/service/gamelift/matchmaking_configuration.go b/internal/service/gamelift/matchmaking_configuration.go
index d8ee20dc65..e17f71e6b6 100644
index 707b1c8e2b..d4fa735fa0 100644
--- a/internal/service/gamelift/matchmaking_configuration.go
+++ b/internal/service/gamelift/matchmaking_configuration.go
@@ -148,7 +148,7 @@ func ResourceMatchMakingConfiguration() *schema.Resource {
Expand All @@ -18,7 +18,7 @@ index d8ee20dc65..e17f71e6b6 100644
input := gamelift.CreateMatchmakingConfigurationInput{
AcceptanceRequired: aws.Bool(d.Get("acceptance_required").(bool)),
diff --git a/internal/service/gamelift/matchmaking_rule_set.go b/internal/service/gamelift/matchmaking_rule_set.go
index 8c1189199f..254c96efc6 100644
index f38585f58d..badb366f31 100644
--- a/internal/service/gamelift/matchmaking_rule_set.go
+++ b/internal/service/gamelift/matchmaking_rule_set.go
@@ -60,7 +60,7 @@ func ResourceMatchmakingRuleSet() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] remove required elements from schema and fix tests (#77)
Co-authored-by: Lee Briggs <[email protected]>

diff --git a/internal/service/gamelift/matchmaking_configuration.go b/internal/service/gamelift/matchmaking_configuration.go
index e17f71e6b6..4a0ccf149d 100644
index d4fa735fa0..4e360e07c7 100644
--- a/internal/service/gamelift/matchmaking_configuration.go
+++ b/internal/service/gamelift/matchmaking_configuration.go
@@ -29,7 +29,7 @@ func ResourceMatchMakingConfiguration() *schema.Resource {
Expand Down Expand Up @@ -169,7 +169,7 @@ index 94c9a8c29b..339f9dd6df 100644
})

diff --git a/internal/service/gamelift/matchmaking_rule_set.go b/internal/service/gamelift/matchmaking_rule_set.go
index 254c96efc6..54b86a0426 100644
index badb366f31..e13832dad8 100644
--- a/internal/service/gamelift/matchmaking_rule_set.go
+++ b/internal/service/gamelift/matchmaking_rule_set.go
@@ -119,11 +119,11 @@ func resourceMatchmakingRuleSetRead(ctx context.Context, d *schema.ResourceData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ index f587fcbcce..f77ca2b249 100644
log.Printf("[DEBUG] Cache security group delete: %s", d.Id())

diff --git a/internal/service/gamelift/matchmaking_configuration.go b/internal/service/gamelift/matchmaking_configuration.go
index 4a0ccf149d..72f7d31d85 100644
index 4e360e07c7..620d913981 100644
--- a/internal/service/gamelift/matchmaking_configuration.go
+++ b/internal/service/gamelift/matchmaking_configuration.go
@@ -146,7 +146,7 @@ func ResourceMatchMakingConfiguration() *schema.Resource {
Expand Down Expand Up @@ -107,7 +107,7 @@ index 4a0ccf149d..72f7d31d85 100644
_, err := conn.DeleteMatchmakingConfiguration(&gamelift.DeleteMatchmakingConfigurationInput{
Name: aws.String(d.Id()),
diff --git a/internal/service/gamelift/matchmaking_rule_set.go b/internal/service/gamelift/matchmaking_rule_set.go
index 54b86a0426..d9f2424b7a 100644
index e13832dad8..bae1c86072 100644
--- a/internal/service/gamelift/matchmaking_rule_set.go
+++ b/internal/service/gamelift/matchmaking_rule_set.go
@@ -58,7 +58,7 @@ func ResourceMatchmakingRuleSet() *schema.Resource {
Expand Down
45 changes: 0 additions & 45 deletions patches/0024-Match-the-tags-behavior-of-other-resources.patch

This file was deleted.

49 changes: 49 additions & 0 deletions patches/0026-Optimize-startup-performance.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anton Tayanovskyy <[email protected]>
Date: Thu, 30 Nov 2023 14:28:37 -0500
Subject: [PATCH] Optimize startup performance


diff --git a/internal/provider/provider_tagcheck.go b/internal/provider/provider_tagcheck.go
new file mode 100644
index 0000000000..8cea6059ba
--- /dev/null
+++ b/internal/provider/provider_tagcheck.go
@@ -0,0 +1,37 @@
+package provider
+
+import (
+ "context"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ "github.com/hashicorp/terraform-provider-aws/names"
+)
+
+type disableTagsSchemaCheckKey struct{}
+
+func DisableTagSchemaCheck(ctx context.Context) context.Context {
+ return context.WithValue(ctx, disableTagsSchemaCheckKey{}, true)
+}
+
+func schemaMapForTagsChecking(ctx context.Context, r *schema.Resource, tagsComputed bool) map[string]*schema.Schema {
+ flag := ctx.Value(disableTagsSchemaCheckKey{})
+ switch flag := flag.(type) {
+ case bool:
+ if flag {
+ //lintignore:S013
+ return map[string]*schema.Schema{
+ names.AttrTags: {
+ Type: schema.TypeMap,
+ Computed: tagsComputed,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ names.AttrTagsAll: {
+ Type: schema.TypeMap,
+ Computed: true,
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ }
+ }
+ }
+ return r.SchemaMap()
+}
Loading
Loading