Skip to content

Commit 13a8e3c

Browse files
committed
args.go
1 parent c506de7 commit 13a8e3c

File tree

2 files changed

+218
-210
lines changed

2 files changed

+218
-210
lines changed

cns/service/args.go

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
package main
2+
3+
import (
4+
"os"
5+
6+
acn "github.com/Azure/azure-container-networking/common"
7+
"github.com/Azure/azure-container-networking/log"
8+
"github.com/Azure/azure-container-networking/platform"
9+
)
10+
11+
// Command line arguments for CNS.
12+
var args = acn.ArgumentList{
13+
{
14+
Name: acn.OptEnvironment,
15+
Shorthand: acn.OptEnvironmentAlias,
16+
Description: "Set the operating environment",
17+
Type: "string",
18+
DefaultValue: acn.OptEnvironmentAzure,
19+
ValueMap: map[string]interface{}{
20+
acn.OptEnvironmentAzure: 0,
21+
acn.OptEnvironmentMAS: 0,
22+
acn.OptEnvironmentFileIpam: 0,
23+
},
24+
},
25+
{
26+
Name: acn.OptAPIServerURL,
27+
Shorthand: acn.OptAPIServerURLAlias,
28+
Description: "Set the API server URL",
29+
Type: "string",
30+
DefaultValue: "",
31+
},
32+
{
33+
Name: acn.OptLogLevel,
34+
Shorthand: acn.OptLogLevelAlias,
35+
Description: "Set the logging level",
36+
Type: "int",
37+
DefaultValue: acn.OptLogLevelInfo,
38+
ValueMap: map[string]interface{}{
39+
acn.OptLogLevelInfo: log.LevelInfo,
40+
acn.OptLogLevelDebug: log.LevelDebug,
41+
},
42+
},
43+
{
44+
Name: acn.OptLogTarget,
45+
Shorthand: acn.OptLogTargetAlias,
46+
Description: "Set the logging target",
47+
Type: "int",
48+
DefaultValue: acn.OptLogTargetFile,
49+
ValueMap: map[string]interface{}{
50+
acn.OptLogTargetSyslog: log.TargetSyslog,
51+
acn.OptLogTargetStderr: log.TargetStderr,
52+
acn.OptLogTargetFile: log.TargetLogfile,
53+
acn.OptLogStdout: log.TargetStdout,
54+
acn.OptLogMultiWrite: log.TargetStdOutAndLogFile,
55+
},
56+
},
57+
{
58+
Name: acn.OptLogLocation,
59+
Shorthand: acn.OptLogLocationAlias,
60+
Description: "Set the directory location where logs will be saved",
61+
Type: "string",
62+
DefaultValue: "",
63+
},
64+
{
65+
Name: acn.OptIpamQueryUrl,
66+
Shorthand: acn.OptIpamQueryUrlAlias,
67+
Description: "Set the IPAM query URL",
68+
Type: "string",
69+
DefaultValue: "",
70+
},
71+
{
72+
Name: acn.OptIpamQueryInterval,
73+
Shorthand: acn.OptIpamQueryIntervalAlias,
74+
Description: "Set the IPAM plugin query interval",
75+
Type: "int",
76+
DefaultValue: "",
77+
},
78+
{
79+
Name: acn.OptCnsURL,
80+
Shorthand: acn.OptCnsURLAlias,
81+
Description: "Set the URL for CNS to listen on",
82+
Type: "string",
83+
DefaultValue: "",
84+
},
85+
{
86+
Name: acn.OptCnsPort,
87+
Shorthand: acn.OptCnsPortAlias,
88+
Description: "Set the URL port for CNS to listen on",
89+
Type: "string",
90+
DefaultValue: "",
91+
},
92+
{
93+
Name: acn.OptVersion,
94+
Shorthand: acn.OptVersionAlias,
95+
Description: "Print version information",
96+
Type: "bool",
97+
DefaultValue: false,
98+
},
99+
{
100+
Name: acn.OptStoreFileLocation,
101+
Shorthand: acn.OptStoreFileLocationAlias,
102+
Description: "Set store file absolute path",
103+
Type: "string",
104+
DefaultValue: platform.CNMRuntimePath,
105+
},
106+
{
107+
Name: acn.OptNetPluginPath,
108+
Shorthand: acn.OptNetPluginPathAlias,
109+
Description: "Set network plugin binary absolute path to parent (of azure-vnet and azure-vnet-ipam)",
110+
Type: "string",
111+
DefaultValue: platform.K8SCNIRuntimePath,
112+
},
113+
{
114+
Name: acn.OptNetPluginConfigFile,
115+
Shorthand: acn.OptNetPluginConfigFileAlias,
116+
Description: "Set network plugin configuration file absolute path",
117+
Type: "string",
118+
DefaultValue: platform.K8SNetConfigPath + string(os.PathSeparator) + defaultCNINetworkConfigFileName,
119+
},
120+
{
121+
Name: acn.OptCreateDefaultExtNetworkType,
122+
Shorthand: acn.OptCreateDefaultExtNetworkTypeAlias,
123+
Description: "Create default external network for windows platform with the specified type (l2bridge)",
124+
Type: "string",
125+
DefaultValue: "",
126+
},
127+
{
128+
Name: acn.OptTelemetry,
129+
Shorthand: acn.OptTelemetryAlias,
130+
Description: "Set to false to disable telemetry. This is deprecated in favor of cns_config.json",
131+
Type: "bool",
132+
DefaultValue: true,
133+
},
134+
{
135+
Name: acn.OptHttpConnectionTimeout,
136+
Shorthand: acn.OptHttpConnectionTimeoutAlias,
137+
Description: "Set HTTP connection timeout in seconds to be used by http client in CNS",
138+
Type: "int",
139+
DefaultValue: "5",
140+
},
141+
{
142+
Name: acn.OptHttpResponseHeaderTimeout,
143+
Shorthand: acn.OptHttpResponseHeaderTimeoutAlias,
144+
Description: "Set HTTP response header timeout in seconds to be used by http client in CNS",
145+
Type: "int",
146+
DefaultValue: "120",
147+
},
148+
{
149+
Name: acn.OptPrivateEndpoint,
150+
Shorthand: acn.OptPrivateEndpointAlias,
151+
Description: "Set private endpoint",
152+
Type: "string",
153+
DefaultValue: "",
154+
},
155+
{
156+
Name: acn.OptInfrastructureNetworkID,
157+
Shorthand: acn.OptInfrastructureNetworkIDAlias,
158+
Description: "Set infrastructure network ID",
159+
Type: "string",
160+
DefaultValue: "",
161+
},
162+
{
163+
Name: acn.OptNodeID,
164+
Shorthand: acn.OptNodeIDAlias,
165+
Description: "Set node name/ID",
166+
Type: "string",
167+
DefaultValue: "",
168+
},
169+
{
170+
Name: acn.OptManaged,
171+
Shorthand: acn.OptManagedAlias,
172+
Description: "Set to true to enable managed mode. This is deprecated in favor of cns_config.json",
173+
Type: "bool",
174+
DefaultValue: false,
175+
},
176+
{
177+
Name: acn.OptDebugCmd,
178+
Shorthand: acn.OptDebugCmdAlias,
179+
Description: "Debug flag to retrieve IPconfigs, available values: assigned, available, all",
180+
Type: "string",
181+
DefaultValue: "",
182+
},
183+
{
184+
Name: acn.OptDebugArg,
185+
Shorthand: acn.OptDebugArgAlias,
186+
Description: "Argument flag to be paired with the 'debugcmd' flag.",
187+
Type: "string",
188+
DefaultValue: "",
189+
},
190+
{
191+
Name: acn.OptCNSConfigPath,
192+
Shorthand: acn.OptCNSConfigPathAlias,
193+
Description: "Path to cns config file",
194+
Type: "string",
195+
DefaultValue: "",
196+
},
197+
{
198+
Name: acn.OptTelemetryService,
199+
Shorthand: acn.OptTelemetryServiceAlias,
200+
Description: "Flag to start telemetry service to receive telemetry events from CNI. Default, disabled.",
201+
Type: "bool",
202+
DefaultValue: false,
203+
},
204+
{
205+
Name: acn.OptCNIConflistFilepath,
206+
Shorthand: acn.OptCNIConflistFilepathAlias,
207+
Description: "Filepath to write CNI conflist when CNI conflist generation is enabled",
208+
Type: "string",
209+
DefaultValue: "",
210+
},
211+
{
212+
Name: acn.OptCNIConflistScenario,
213+
Shorthand: acn.OptCNIConflistScenarioAlias,
214+
Description: "Scenario to generate CNI conflist for",
215+
Type: "string",
216+
DefaultValue: "",
217+
},
218+
}

0 commit comments

Comments
 (0)