From 4e67f92306d3c92ba0a56ed40ef5019491453d95 Mon Sep 17 00:00:00 2001 From: Ashvin Deodhar Date: Wed, 24 Jul 2019 09:30:43 -0700 Subject: [PATCH 1/2] Do not start CNM by default --- cns/service/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cns/service/main.go b/cns/service/main.go index 4e06be9c07..289e13f972 100644 --- a/cns/service/main.go +++ b/cns/service/main.go @@ -162,7 +162,7 @@ func printVersion() { // Main is the entry point for CNS. func main() { - var stopcnm = false + var stopcnm = true // Initialize and parse command line arguments. acn.ParseArgs(&args, printVersion) From 72dfc7483420f917332cb59ab3b9ab840a5a14ab Mon Sep 17 00:00:00 2001 From: Ashvin Deodhar Date: Wed, 24 Jul 2019 14:49:46 -0700 Subject: [PATCH 2/2] rename the var to startcnm --- cns/service/main.go | 13 ++++++------- common/config.go | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cns/service/main.go b/cns/service/main.go index 289e13f972..a7b2af83e6 100644 --- a/cns/service/main.go +++ b/cns/service/main.go @@ -111,9 +111,9 @@ var args = acn.ArgumentList{ DefaultValue: "", }, { - Name: acn.OptStopAzureVnet, - Shorthand: acn.OptStopAzureVnetAlias, - Description: "Stop Azure-CNM if flag is true", + Name: acn.OptStartAzureCNM, + Shorthand: acn.OptStartAzureCNMAlias, + Description: "Start Azure-CNM if flag is set", Type: "bool", DefaultValue: false, }, @@ -162,7 +162,6 @@ func printVersion() { // Main is the entry point for CNS. func main() { - var stopcnm = true // Initialize and parse command line arguments. acn.ParseArgs(&args, printVersion) @@ -176,7 +175,7 @@ func main() { logDirectory := acn.GetArg(acn.OptLogLocation).(string) ipamQueryUrl, _ := acn.GetArg(acn.OptIpamQueryUrl).(string) ipamQueryInterval, _ := acn.GetArg(acn.OptIpamQueryInterval).(int) - stopcnm = acn.GetArg(acn.OptStopAzureVnet).(bool) + startCNM := acn.GetArg(acn.OptStartAzureCNM).(bool) vers := acn.GetArg(acn.OptVersion).(bool) createDefaultExtNetworkType := acn.GetArg(acn.OptCreateDefaultExtNetworkType).(string) telemetryEnabled := acn.GetArg(acn.OptTelemetry).(bool) @@ -271,7 +270,7 @@ func main() { var netPlugin network.NetPlugin var ipamPlugin ipam.IpamPlugin - if !stopcnm { + if startCNM { var pluginConfig acn.PluginConfig pluginConfig.Version = version @@ -344,7 +343,7 @@ func main() { telemetryStopProcessing <- true - if !stopcnm { + if startCNM { if netPlugin != nil { netPlugin.Stop() } diff --git a/common/config.go b/common/config.go index 89e86cc746..c1c4b23488 100644 --- a/common/config.go +++ b/common/config.go @@ -44,9 +44,9 @@ const ( OptIpamQueryInterval = "ipam-query-interval" OptIpamQueryIntervalAlias = "i" - // Don't Start CNM - OptStopAzureVnet = "stop-azure-cnm" - OptStopAzureVnetAlias = "stopcnm" + // Start CNM + OptStartAzureCNM = "start-azure-cnm" + OptStartAzureCNMAlias = "startcnm" // Interval to send reports to host OptReportToHostInterval = "report-interval"