mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #12549 from eparis/remove-BindClientConfigFlags
Remove BindClientConfigFlags entirely
This commit is contained in:
commit
077246219b
@ -306,7 +306,6 @@ func (s *APIServer) Run(_ []string) error {
|
||||
// This takes preference over api/all, if specified.
|
||||
enableExp := s.getRuntimeConfigValue("experimental/v1", false)
|
||||
|
||||
// TODO: expose same flags as client.BindClientConfigFlags but for a server
|
||||
clientConfig := &client.Config{
|
||||
Host: net.JoinHostPort(s.InsecureBindAddress.String(), strconv.Itoa(s.InsecurePort)),
|
||||
Version: s.StorageVersion,
|
||||
|
@ -27,23 +27,9 @@ type FlagSet interface {
|
||||
BoolVar(p *bool, name string, value bool, usage string)
|
||||
UintVar(p *uint, name string, value uint, usage string)
|
||||
DurationVar(p *time.Duration, name string, value time.Duration, usage string)
|
||||
Float32Var(p *float32, name string, value float32, usage string)
|
||||
IntVar(p *int, name string, value int, usage string)
|
||||
}
|
||||
|
||||
// BindClientConfigFlags registers a standard set of CLI flags for connecting to a Kubernetes API server.
|
||||
// TODO this method is superseded by pkg/client/clientcmd/client_builder.go
|
||||
func BindClientConfigFlags(flags FlagSet, config *Config) {
|
||||
flags.StringVar(&config.Host, "master", config.Host, "The address of the Kubernetes API server")
|
||||
flags.StringVar(&config.Version, "api_version", config.Version, "The API version to use when talking to the server")
|
||||
flags.BoolVar(&config.Insecure, "insecure_skip_tls_verify", config.Insecure, "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.")
|
||||
flags.StringVar(&config.CertFile, "client_certificate", config.CertFile, "Path to a client key file for TLS.")
|
||||
flags.StringVar(&config.KeyFile, "client_key", config.KeyFile, "Path to a client key file for TLS.")
|
||||
flags.StringVar(&config.CAFile, "certificate_authority", config.CAFile, "Path to a cert. file for the certificate authority.")
|
||||
flags.Float32Var(&config.QPS, "max_outgoing_qps", config.QPS, "Maximum number of queries per second that could be issued by this client.")
|
||||
flags.IntVar(&config.Burst, "max_outgoing_burst", config.Burst, "Maximum throttled burst")
|
||||
}
|
||||
|
||||
func BindKubeletClientConfigFlags(flags FlagSet, config *KubeletConfig) {
|
||||
flags.BoolVar(&config.EnableHttps, "kubelet_https", config.EnableHttps, "Use https for kubelet connections")
|
||||
flags.UintVar(&config.Port, "kubelet_port", config.Port, "Kubelet port")
|
||||
|
@ -68,16 +68,6 @@ func (f *fakeFlagSet) DurationVar(p *time.Duration, name string, value time.Dura
|
||||
f.set.Insert(name)
|
||||
}
|
||||
|
||||
func (f *fakeFlagSet) Float32Var(p *float32, name string, value float32, usage string) {
|
||||
if p == nil {
|
||||
f.t.Errorf("unexpected nil pointer")
|
||||
}
|
||||
if usage == "" {
|
||||
f.t.Errorf("unexpected empty usage")
|
||||
}
|
||||
f.set.Insert(name)
|
||||
}
|
||||
|
||||
func (f *fakeFlagSet) IntVar(p *int, name string, value int, usage string) {
|
||||
if p == nil {
|
||||
f.t.Errorf("unexpected nil pointer")
|
||||
@ -88,15 +78,6 @@ func (f *fakeFlagSet) IntVar(p *int, name string, value int, usage string) {
|
||||
f.set.Insert(name)
|
||||
}
|
||||
|
||||
func TestBindClientConfigFlags(t *testing.T) {
|
||||
flags := &fakeFlagSet{t, util.StringSet{}}
|
||||
config := &Config{}
|
||||
BindClientConfigFlags(flags, config)
|
||||
if len(flags.set) != 8 {
|
||||
t.Errorf("unexpected flag set: %#v", flags)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBindKubeletClientConfigFlags(t *testing.T) {
|
||||
flags := &fakeFlagSet{t, util.StringSet{}}
|
||||
config := &KubeletConfig{}
|
||||
|
Loading…
Reference in New Issue
Block a user