From d6aedbf2fcbf85e8bacffdbf1b6e8696b0104e7b Mon Sep 17 00:00:00 2001 From: phamann Date: Wed, 30 Aug 2017 11:38:50 +0100 Subject: [PATCH] Update/add references to ExternalTrafficPolicy in structure_service_spec --- kubernetes/structure_service_spec.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kubernetes/structure_service_spec.go b/kubernetes/structure_service_spec.go index 2e61fbd4f8..4ca8f06be4 100644 --- a/kubernetes/structure_service_spec.go +++ b/kubernetes/structure_service_spec.go @@ -58,6 +58,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} } @@ -139,7 +142,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 } @@ -209,5 +212,11 @@ func patchServiceSpec(keyPrefix, pathPrefix string, d *schema.ResourceData, v *v 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, nil }