apiserver command line options lead to config
This commit is contained in:
parent
8b7b2e3701
commit
409dcf10b4
|
|
@ -104,14 +104,18 @@ func (serverOptions *ServerRunOptions) Run(stopCh <-chan struct{}) error {
|
||||||
|
|
||||||
// create config from options
|
// create config from options
|
||||||
config := genericapiserver.NewConfig().
|
config := genericapiserver.NewConfig().
|
||||||
WithSerializer(api.Codecs).
|
WithSerializer(api.Codecs)
|
||||||
ApplyOptions(serverOptions.GenericServerRunOptions).
|
|
||||||
ApplyInsecureServingOptions(serverOptions.InsecureServing)
|
|
||||||
|
|
||||||
if _, err := config.ApplySecureServingOptions(serverOptions.SecureServing); err != nil {
|
if err := serverOptions.GenericServerRunOptions.ApplyTo(config); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := serverOptions.InsecureServing.ApplyTo(config); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := serverOptions.SecureServing.ApplyTo(config); err != nil {
|
||||||
return fmt.Errorf("failed to configure https: %s", err)
|
return fmt.Errorf("failed to configure https: %s", err)
|
||||||
}
|
}
|
||||||
if err := serverOptions.Authentication.Apply(config); err != nil {
|
if err := serverOptions.Authentication.ApplyTo(config); err != nil {
|
||||||
return fmt.Errorf("failed to configure authentication: %s", err)
|
return fmt.Errorf("failed to configure authentication: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue