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

Defect duplicate tags #196

Merged
merged 3 commits into from
Dec 6, 2023
Merged

Defect duplicate tags #196

merged 3 commits into from
Dec 6, 2023

Conversation

LumaC0
Copy link
Contributor

@LumaC0 LumaC0 commented Nov 29, 2023

Change Log Items

  • Fixes a bug that ignores resource tags if the key-value pair also exists in default_tags

Description

Adds a ResolveDuplicates function to check for tags from terraform's configuration along with tags retrieved directly from AWS. Most of the code was taken from this PR: hashicorp/terraform-provider-aws#30793, removing interceptor code not relevant to the ALKS provider

Acceptance Tests Results

➜ make testacc TESTARGS="-run TestAccAlksIamRole"                                 

TF_ACC=1 go test -timeout 1200s -v . -run TestAccAlksIamRole
=== RUN   TestAccAlksIamRole_Basic
--- PASS: TestAccAlksIamRole_Basic (45.98s)
=== RUN   TestAccAlksIamRole_Tags
--- PASS: TestAccAlksIamRole_Tags (43.11s)
=== RUN   TestAccAlksIamRole_DefaultTags_TrustPolicy
--- PASS: TestAccAlksIamRole_DefaultTags_TrustPolicy (47.72s)
=== RUN   TestAccAlksIamRole_DefaultTags_TrustPolicyUpdate
--- PASS: TestAccAlksIamRole_DefaultTags_TrustPolicyUpdate (46.29s)
=== RUN   TestAccAlksIamRole_DefaultTags_RoleType
--- PASS: TestAccAlksIamRole_DefaultTags_RoleType (43.01s)
=== RUN   TestAccAlksIamRole_DefaultTagsEmpty
--- PASS: TestAccAlksIamRole_DefaultTagsEmpty (35.28s)
=== RUN   TestAccAlksIamRole_DefaultTagSameAsResourceTag
--- PASS: TestAccAlksIamRole_DefaultTagSameAsResourceTag (43.47s)
=== RUN   TestAccAlksIamRole_IgnoreTagsEmpty
--- PASS: TestAccAlksIamRole_IgnoreTagsEmpty (43.41s)
=== RUN   TestAccAlksIamRole_IgnoreTags
--- PASS: TestAccAlksIamRole_IgnoreTags (35.24s)
=== RUN   TestAccAlksIamRole_NoMaxDuration
--- PASS: TestAccAlksIamRole_NoMaxDuration (44.34s)
PASS
ok      github.com/Cox-Automotive/terraform-provider-alks       427.845s

Rally: DE379216: ALKS Terraform provider defect

@LumaC0 LumaC0 force-pushed the defect-duplicate-tags branch from 4efbca5 to 6ccf065 Compare November 30, 2023 15:22
@@ -7,9 +7,9 @@ import (
"testing"

"github.com/Cox-Automotive/alks-go"
awspolicy "github.com/hashicorp/awspolicyequivalence"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious. Is there a mechanical go reason you changed the order?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go fmt actually did this

@LumaC0 LumaC0 merged commit 09b55f9 into master Dec 6, 2023
4 checks passed
@LumaC0 LumaC0 deleted the defect-duplicate-tags branch December 6, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants