From a88e8e21583179d02eba4c72e3d144a5771ef7c9 Mon Sep 17 00:00:00 2001 From: zhengjiajin Date: Wed, 6 Sep 2017 18:10:19 +0800 Subject: [PATCH] fix issue(#47976)Invalid value error when creating service from exported config --- pkg/registry/core/service/strategy.go | 2 +- pkg/registry/core/service/strategy_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/registry/core/service/strategy.go b/pkg/registry/core/service/strategy.go index 1d3da254978..e2bf47a545d 100644 --- a/pkg/registry/core/service/strategy.go +++ b/pkg/registry/core/service/strategy.go @@ -89,7 +89,7 @@ func (svcStrategy) Export(ctx genericapirequest.Context, obj runtime.Object, exa return nil } if t.Spec.ClusterIP != api.ClusterIPNone { - t.Spec.ClusterIP = "" + t.Spec.ClusterIP = "" } if t.Spec.Type == api.ServiceTypeNodePort { for i := range t.Spec.Ports { diff --git a/pkg/registry/core/service/strategy_test.go b/pkg/registry/core/service/strategy_test.go index 46e3c65546e..903af1ec03b 100644 --- a/pkg/registry/core/service/strategy_test.go +++ b/pkg/registry/core/service/strategy_test.go @@ -81,7 +81,7 @@ func TestExportService(t *testing.T) { Namespace: "bar", }, Spec: api.ServiceSpec{ - ClusterIP: "", + ClusterIP: "", }, }, },