initFlags initializes flags by section name.
()
| 91 | |
| 92 | // initFlags initializes flags by section name. |
| 93 | func (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 | |
| 116 | func (o *Options) Config() (*config.Config, error) { |
| 117 | if filedErr := o.Validate(); filedErr.ToAggregate() != nil { |
no outgoing calls
no test coverage detected