@@ -38,7 +38,7 @@ var schemaNodeConfig = &schema.Schema{
38
38
},
39
39
40
40
"oauth_scopes" : {
41
- Type : schema .TypeList ,
41
+ Type : schema .TypeSet ,
42
42
Optional : true ,
43
43
Computed : true ,
44
44
ForceNew : true ,
@@ -48,6 +48,7 @@ var schemaNodeConfig = &schema.Schema{
48
48
return canonicalizeServiceScope (v .(string ))
49
49
},
50
50
},
51
+ Set : stringScopeHashcode ,
51
52
},
52
53
53
54
"service_account" : {
@@ -113,11 +114,11 @@ func expandNodeConfig(v interface{}) *container.NodeConfig {
113
114
nc .LocalSsdCount = int64 (v .(int ))
114
115
}
115
116
116
- if v , ok := nodeConfig ["oauth_scopes" ]; ok {
117
- scopesList := v .([] interface {} )
118
- scopes := []string {}
119
- for _ , v := range scopesList {
120
- scopes = append ( scopes , canonicalizeServiceScope (v .(string ) ))
117
+ if scopes , ok := nodeConfig ["oauth_scopes" ]; ok {
118
+ scopesSet := scopes .( * schema. Set )
119
+ scopes := make ( []string , scopesSet . Len ())
120
+ for i , scope := range scopesSet . List () {
121
+ scopes [ i ] = canonicalizeServiceScope (scope .(string ))
121
122
}
122
123
123
124
nc .OauthScopes = scopes
@@ -181,7 +182,7 @@ func flattenNodeConfig(c *container.NodeConfig) []map[string]interface{} {
181
182
})
182
183
183
184
if len (c .OauthScopes ) > 0 {
184
- config [0 ]["oauth_scopes" ] = c .OauthScopes
185
+ config [0 ]["oauth_scopes" ] = schema . NewSet ( stringScopeHashcode , convertStringArrToInterface ( c .OauthScopes ))
185
186
}
186
187
187
188
return config
0 commit comments