From 988c4ae6baed8fcf5e06fc55e1ec031bf3d3815c Mon Sep 17 00:00:00 2001 From: m1093782566 Date: Wed, 10 Jan 2018 10:06:33 +0800 Subject: [PATCH] fix windows ut for proxy mode --- .../apis/kubeproxyconfig/validation/validation_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go b/pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go index aaf5e9f4a9164..8815e0af077b8 100644 --- a/pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go +++ b/pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go @@ -30,6 +30,12 @@ import ( ) func TestValidateKubeProxyConfiguration(t *testing.T) { + var proxyMode kubeproxyconfig.ProxyMode + if runtime.GOOS == "windows" { + proxyMode = kubeproxyconfig.ProxyModeKernelspace + } else { + proxyMode = kubeproxyconfig.ProxyModeIPVS + } successCases := []kubeproxyconfig.KubeProxyConfiguration{ { BindAddress: "192.168.59.103", @@ -43,7 +49,7 @@ func TestValidateKubeProxyConfiguration(t *testing.T) { SyncPeriod: metav1.Duration{Duration: 5 * time.Second}, MinSyncPeriod: metav1.Duration{Duration: 2 * time.Second}, }, - Mode: kubeproxyconfig.ProxyModeIPVS, + Mode: proxyMode, IPVS: kubeproxyconfig.KubeProxyIPVSConfiguration{ SyncPeriod: metav1.Duration{Duration: 10 * time.Second}, MinSyncPeriod: metav1.Duration{Duration: 5 * time.Second},