check for sets in node pool tests (#661)

This commit is contained in:
Dana Hoffman 2017-11-03 15:07:01 -07:00 committed by GitHub
parent 794d971695
commit 49a91427b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,6 +197,10 @@ func testAccCheckContainerNodePoolDestroy(s *terraform.State) error {
return nil
}
var nodepoolSetFields map[string]struct{} = map[string]struct{}{
"node_config.0.oauth_scopes": struct{}{},
}
func testAccCheckContainerNodePoolMatches(n string) resource.TestCheckFunc {
return func(s *terraform.State) error {
config := testAccProvider.Meta().(*Config)
@ -414,6 +418,9 @@ resource "google_container_node_pool" "np" {
func nodepoolCheckMatch(attributes map[string]string, attr string, gcp interface{}) string {
if gcpList, ok := gcp.([]string); ok {
if _, ok := nodepoolSetFields[attr]; ok {
return nodepoolCheckSetMatch(attributes, attr, gcpList)
}
return nodepoolCheckListMatch(attributes, attr, gcpList)
}
if gcpMap, ok := gcp.(map[string]string); ok {