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

resource/aws_codebuild_project: Prevent crash when using source auth configuration #3271

Merged
merged 2 commits into from
Feb 7, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Feb 6, 2018

Previously:

 make testacc TEST=./aws TESTARGS='-run=TestAccAWSCodeBuildProject_sourceAuth'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCodeBuildProject_sourceAuth -timeout 120m
=== RUN   TestAccAWSCodeBuildProject_sourceAuth
panic: interface conversion: interface {} is map[string]interface {}, not *schema.Set

goroutine 606 [running]:
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc4204a7840, 0xc42081bad0, 0x3, 0x3, 0x3440d20, 0xc42081b9e0, 0xc4203b52c0, 0xffffffffffffffff, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:343 +0xb95
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc4204a7840, 0xc42081bad0, 0x3, 0x3, 0x3440d20, 0xc42081b9e0, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:107 +0x2ac
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setObject(0xc4204a7840, 0xc4204a78a0, 0x2, 0x2, 0x3440d20, 0xc42081b9b0, 0xc420928960, 0x0, 0x1836aa4)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:225 +0x241
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc4204a7840, 0xc4204a78a0, 0x2, 0x2, 0x3440d20, 0xc42081b9b0, 0x1, 0x1)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:109 +0x22b
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setList.func1(0x3a97667, 0x1, 0x3440d20, 0xc42081b9b0, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:123 +0x139
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setList(0xc4204a7840, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0xc4209283c0, 0x6, 0xc42039d9d0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:143 +0x242
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc4204a7840, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0x1, 0x600000000d0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:103 +0x10b
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).WriteField(0xc4204a7840, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:89 +0x49e
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc420632e80, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0xc4203b5d10, 0x6, 0xc42039d9d0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:306 +0x681
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc420632e80, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0x1, 0x1)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:107 +0x2ac
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).WriteField(0xc420632e80, 0xc420719460, 0x1, 0x1, 0x316aca0, 0xc4204a7800, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:89 +0x49e
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ResourceData).Set(0xc4201adb90, 0x39c422d, 0x6, 0x316aca0, 0xc4204a7800, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go:189 +0x12b
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCodeBuildProjectRead(0xc4201adb90, 0x35bfbe0, 0xc4200a7b80, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_codebuild_project.go:391 +0x344
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCodeBuildProjectUpdate(0xc4201adb90, 0x35bfbe0, 0xc4200a7b80, 0x0, 0xc420a59470)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_codebuild_project.go:458 +0x48c
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCodeBuildProjectCreate(0xc4201adb90, 0x35bfbe0, 0xc4200a7b80, 0xc4201adb90, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_codebuild_project.go:246 +0x539
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc42039da40, 0xc4201bed20, 0xc42061bb60, 0x35bfbe0, 0xc4200a7b80, 0xc42063e801, 0x39, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:227 +0x364
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc4200fae70, 0xc4205dd7c0, 0xc4201bed20, 0xc42061bb60, 0x1, 0x54, 0x13)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0xa4
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.(*EvalApply).Eval(0xc4202c6d00, 0x586b3c0, 0xc4207f4680, 0x2, 0x2, 0x39c1bf5, 0x4)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/eval_apply.go:57 +0x239
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.EvalRaw(0x585afa0, 0xc4202c6d00, 0x586b3c0, 0xc4207f4680, 0x0, 0x0, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x173
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc4205839c0, 0x586b3c0, 0xc4207f4680, 0x2, 0x2, 0x39c1bf5, 0x4)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/eval_sequence.go:14 +0x7e
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.EvalRaw(0x585ba60, 0xc4205839c0, 0x586b3c0, 0xc4207f4680, 0x33fe6e0, 0x586c402, 0x31ad300, 0xc4205c9900)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/eval.go:53 +0x173
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.Eval(0x585ba60, 0xc4205839c0, 0x586b3c0, 0xc4207f4680, 0xc4205839c0, 0x585ba60, 0xc4205839c0, 0x108c8d4)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/eval.go:34 +0x4d
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x3927140, 0xc42000e330, 0x0, 0x0)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/terraform/graph.go:126 +0xd0d
github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc4205432d0, 0x3927140, 0xc42000e330, 0xc420a70700)
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/dag/walk.go:387 +0x3c1
created by github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/dag.(*Walker).Update
	/Users/bflad/go/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/dag/walk.go:310 +0x1364
exit status 2
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	22.678s
make: *** [testacc] Error 1

Tests pass with new code:

=== RUN   TestAccAWSCodeBuildProject_sourceAuth
--- PASS: TestAccAWSCodeBuildProject_sourceAuth (26.59s)
=== RUN   TestAccAWSCodeBuildProject_default_build_timeout
--- PASS: TestAccAWSCodeBuildProject_default_build_timeout (33.90s)
=== RUN   TestAccAWSCodeBuildProject_basic
--- PASS: TestAccAWSCodeBuildProject_basic (34.03s)

@bflad bflad added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/codebuild Issues and PRs that pertain to the codebuild service. labels Feb 6, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Feb 6, 2018
@bflad bflad changed the title [WIP] resource/aws_codebuild_project: Prevent crash when using source auth configuration resource/aws_codebuild_project: Prevent crash when using source auth configuration Feb 6, 2018
@bflad bflad added this to the v1.9.0 milestone Feb 6, 2018
@bflad bflad requested a review from a team February 6, 2018 21:49
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bflad bflad merged commit 7bc2c03 into master Feb 7, 2018
@bflad bflad deleted the b-aws_codebuild_project-source-auth-crash branch February 7, 2018 11:33
bflad added a commit that referenced this pull request Feb 7, 2018
@bflad
Copy link
Contributor Author

bflad commented Feb 9, 2018

This has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 8, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/codebuild Issues and PRs that pertain to the codebuild service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants