Add DiffSuppressFunc to GKE cluster networks (#419)

* fix gke network test
* use a state func to store the resource name
This commit is contained in:
Dana Hoffman 2017-09-15 00:36:29 +08:00 committed by Vincent Roseberry
parent 68303edb42
commit 5f86f52d1f
2 changed files with 9 additions and 4 deletions

View File

@ -176,10 +176,11 @@ func resourceContainerCluster() *schema.Resource {
},
"network": {
Type: schema.TypeString,
Optional: true,
Default: "default",
ForceNew: true,
Type: schema.TypeString,
Optional: true,
Default: "default",
ForceNew: true,
StateFunc: StoreResourceName,
},
"subnetwork": {
Type: schema.TypeString,

View File

@ -69,3 +69,7 @@ func GetResourceNameFromSelfLink(link string) string {
parts := strings.Split(link, "/")
return parts[len(parts)-1]
}
func StoreResourceName(resourceLink interface{}) string {
return GetResourceNameFromSelfLink(resourceLink.(string))
}