From 28434b4a128f69917b6e9d12f3863556e92c3dd7 Mon Sep 17 00:00:00 2001 From: Quang Nguyen Date: Thu, 18 Jan 2024 15:29:55 -0500 Subject: [PATCH] typed SWIFTV2Mode --- cns/configuration/configuration.go | 2 +- cns/service/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cns/configuration/configuration.go b/cns/configuration/configuration.go index 59603b2e96..005ed3f83b 100644 --- a/cns/configuration/configuration.go +++ b/cns/configuration/configuration.go @@ -30,7 +30,7 @@ type CNSConfig struct { EnablePprof bool EnableSubnetScarcity bool EnableSwiftV2 bool - SWIFTV2Mode string + SWIFTV2Mode SWIFTV2Mode InitializeFromCNI bool ManagedSettings ManagedSettings MetricsBindAddress string diff --git a/cns/service/main.go b/cns/service/main.go index cb2b7b6154..94a8cfd878 100644 --- a/cns/service/main.go +++ b/cns/service/main.go @@ -1383,7 +1383,7 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn // if SWIFT v2 is enabled on CNS, attach multitenant middleware to rest service // switch here for different type of swift v2 middleware (k8s or SF) var swiftV2Middleware cns.IPConfigsHandlerMiddleware - switch configuration.SWIFTV2Mode(cnsconfig.SWIFTV2Mode) { + switch cnsconfig.SWIFTV2Mode { case configuration.K8sSWIFTV2: swiftV2Middleware = &middlewares.K8sSWIFTv2Middleware{Cli: manager.GetClient()} case configuration.SFSWIFTV2: