From fe930bf7874151a47f2a9262fbdf7bd7afa93124 Mon Sep 17 00:00:00 2001 From: sh2 Date: Sun, 12 Nov 2023 15:53:48 +0800 Subject: [PATCH] clean old updates in envoyproxy validate methods Signed-off-by: sh2 --- api/v1alpha1/validation/envoyproxy_validate.go | 3 +-- api/v1alpha1/validation/envoyproxy_validate_test.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/validation/envoyproxy_validate.go b/api/v1alpha1/validation/envoyproxy_validate.go index 2c2a12b8400b..6c608f0e0f77 100644 --- a/api/v1alpha1/validation/envoyproxy_validate.go +++ b/api/v1alpha1/validation/envoyproxy_validate.go @@ -98,8 +98,7 @@ func validateService(spec *egv1a1.EnvoyProxySpec) []error { errs = append(errs, fmt.Errorf("allocateLoadBalancerNodePorts can only be set for %v type", egv1a1.ServiceTypeLoadBalancer)) } } - if serviceType, serviceLoadBalancerIP := - spec.Provider.Kubernetes.EnvoyService.Type, spec.Provider.Kubernetes.EnvoyService.LoadBalancerIP; serviceType != nil && serviceLoadBalancerIP != nil { + if serviceType, serviceLoadBalancerIP := spec.Provider.Kubernetes.EnvoyService.Type, spec.Provider.Kubernetes.EnvoyService.LoadBalancerIP; serviceType != nil && serviceLoadBalancerIP != nil { if *serviceType != egv1a1.ServiceTypeLoadBalancer { errs = append(errs, fmt.Errorf("loadBalancerIP can only be set for %v type", egv1a1.ServiceTypeLoadBalancer)) } diff --git a/api/v1alpha1/validation/envoyproxy_validate_test.go b/api/v1alpha1/validation/envoyproxy_validate_test.go index 66f74324183b..0bfc5558e1b0 100644 --- a/api/v1alpha1/validation/envoyproxy_validate_test.go +++ b/api/v1alpha1/validation/envoyproxy_validate_test.go @@ -276,6 +276,7 @@ func TestValidateEnvoyProxy(t *testing.T) { }, expected: false, }, + { name: "valid user bootstrap replace type", proxy: &egv1a1.EnvoyProxy{