diff --git a/pkg/flags/flags.go b/pkg/flags/flags.go index ae6daa084d..d5d6db5936 100644 --- a/pkg/flags/flags.go +++ b/pkg/flags/flags.go @@ -143,7 +143,7 @@ var F = struct { ClusterSliceAPIGroup string EnableL4ILBMixedProtocol bool EnableL4NetLBMixedProtocol bool - EnableIPV6NEG bool + EnableIPV6OnlyNEG bool }{ GCERateLimitScale: 1.0, } @@ -335,7 +335,7 @@ L7 load balancing. CSV values accepted. Example: -node-port-ranges=80,8080,400-5 flag.BoolVar(&F.EnableL4ILBMixedProtocol, "enable-l4ilb-mixed-protocol", false, "Enable support for mixed protocol L4 internal load balancers.") flag.BoolVar(&F.EnableL4NetLBMixedProtocol, "enable-l4netlb-mixed-protocol", false, "Enable support for mixed protocol L4 external load balancers.") flag.StringVar(&F.ClusterSliceAPIGroup, "cluster-slice-api-group", "", "The API group for the ClusterSlice CRD.") - flag.BoolVar(&F.EnableIPV6NEG, "enable-ipv6-neg", false, "Enable support for IPV6 NEG's.") + flag.BoolVar(&F.EnableIPV6OnlyNEG, "enable-ipv6-only-neg", false, "Enable support for IPV6 Only NEG's.") } func Validate() { diff --git a/pkg/neg/controller.go b/pkg/neg/controller.go index 441428a2bb..bca2bc1ebd 100644 --- a/pkg/neg/controller.go +++ b/pkg/neg/controller.go @@ -561,7 +561,7 @@ func (c *Controller) processService(key string) error { } if len(svcPortInfoMap) != 0 { c.logger.V(2).Info("Syncing service", "service", key) - if !flags.F.EnableIPV6NEG { + if !flags.F.EnableIPV6OnlyNEG { if service.Spec.Type != apiv1.ServiceTypeLoadBalancer && isSingleStackIPv6Service(service) { return fmt.Errorf("NEG is not supported for ipv6 only service (%T)", service) } diff --git a/pkg/neg/controller_test.go b/pkg/neg/controller_test.go index 5d5b20b035..4d02d541ff 100644 --- a/pkg/neg/controller_test.go +++ b/pkg/neg/controller_test.go @@ -1590,9 +1590,9 @@ func TestServiceIPFamilies(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { if tc.enableIPV6OnlyNEG { - flags.F.EnableIPV6NEG = true + flags.F.EnableIPV6OnlyNEG = true defer func() { - flags.F.EnableIPV6NEG = false + flags.F.EnableIPV6OnlyNEG = false }() } controller := newTestController(fake.NewSimpleClientset())