Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions cns/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -162,7 +162,6 @@ func printVersion() {

// Main is the entry point for CNS.
func main() {
var stopcnm = false
// Initialize and parse command line arguments.
acn.ParseArgs(&args, printVersion)

Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -344,7 +343,7 @@ func main() {

telemetryStopProcessing <- true

if !stopcnm {
if startCNM {
if netPlugin != nil {
netPlugin.Stop()
}
Expand Down
6 changes: 3 additions & 3 deletions common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down