MCPcopy Create free account
hub / github.com/cloudtty/cloudtty / Flags

Method Flags

cmd/app/options/option.go:93–114  ·  view source on GitHub ↗

initFlags initializes flags by section name.

()

Source from the content-addressed store, hash-verified

91
92// initFlags initializes flags by section name.
93func (o *Options) Flags() cliflag.NamedFlagSets {
94 nfs := cliflag.NamedFlagSets{}
95 genericfs := nfs.FlagSet("generic")
96
97 genericfs.StringVar(&o.ClientConnection.ContentType, "kube-api-content-type", o.ClientConnection.ContentType, "Content type of requests sent to apiserver.")
98 genericfs.Float32Var(&o.ClientConnection.QPS, "kube-api-qps", o.ClientConnection.QPS, "QPS to use while talking with kubernetes apiserver.")
99 genericfs.Int32Var(&o.ClientConnection.Burst, "kube-api-burst", o.ClientConnection.Burst, "Burst to use while talking with kubernetes apiserver.")
100 genericfs.IntVar(&o.CoreWorkerLimit, "core-worker-limit", 5, "The core limit of worker pool.")
101 genericfs.IntVar(&o.MaxWorkerLimit, "max-worker-limit", 10, "The max limit of worker pool.")
102 genericfs.StringVar(&o.ClouShellImage, "cloudshell-image", "", "The cloudshell image.")
103 genericfs.StringToStringVar(&o.NodeSelector, "cloudshell-node-selector", o.NodeSelector, "The cloudshell node selector.")
104 genericfs.Var(&o.Resources, "cloudshell-resources", "The cloudshell resources.")
105
106 fs := nfs.FlagSet("misc")
107 fs.StringVar(&o.Master, "master", o.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).")
108 fs.StringVar(&o.Kubeconfig, "kubeconfig", o.Kubeconfig, "Path to kubeconfig file with authorization and master location information.")
109
110 options.BindLeaderElectionFlags(&o.LeaderElection, genericfs)
111 logsapi.AddFlags(o.Logs, nfs.FlagSet("logs"))
112
113 return nfs
114}
115
116func (o *Options) Config() (*config.Config, error) {
117 if filedErr := o.Validate(); filedErr.ToAggregate() != nil {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected