Skip to content

Commit

Permalink
Update/add references to ExternalTrafficPolicy in structure_service_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
phamann committed Aug 30, 2017
1 parent b885331 commit 6bccc7c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kubernetes/structure_service_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func flattenServiceSpec(in v1.ServiceSpec) []interface{} {
if in.ExternalName != "" {
att["external_name"] = in.ExternalName
}
if in.ExternalTrafficPolicy != "" {
att["external_traffic_policy"] = in.ExternalTrafficPolicy
}
return []interface{}{att}
}

Expand Down Expand Up @@ -137,7 +140,7 @@ func expandServiceSpec(l []interface{}) v1.ServiceSpec {
obj.ExternalName = v
}
if v, ok := in["external_traffic_policy"].(string); ok {
obj.ExternalName = v
obj.ExternalTrafficPolicy = v
}
return obj
}
Expand Down Expand Up @@ -200,5 +203,11 @@ func patchServiceSpec(keyPrefix, pathPrefix string, d *schema.ResourceData) Patc
Value: d.Get(keyPrefix + "external_name").(string),
})
}
if d.HasChange(keyPrefix + "external_traffic_policy") {
ops = append(ops, &ReplaceOperation{
Path: pathPrefix + "externalTrafficPolicy",
Value: d.Get(keyPrefix + "external_traffic_policy").(string),
})
}
return ops
}

0 comments on commit 6bccc7c

Please sign in to comment.