mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Autoset OpenAPI version w/o SecurityDefinitions
There's code to automatically populate OpenAPI info based on existing generic apiserver config, but it only fires if securitydefinitions are present. This doesn't make much sense, since this info is both required and independent of security definitions, and there's no easy, generic way to generate security definitions for an aggregated API server.
This commit is contained in:
parent
d08e68e759
commit
ef73bb684b
@ -366,7 +366,8 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo
|
||||
c.ExternalAddress = net.JoinHostPort(c.ExternalAddress, strconv.Itoa(port))
|
||||
}
|
||||
|
||||
if c.OpenAPIConfig != nil && c.OpenAPIConfig.SecurityDefinitions != nil {
|
||||
if c.OpenAPIConfig != nil {
|
||||
if c.OpenAPIConfig.SecurityDefinitions != nil {
|
||||
// Setup OpenAPI security: all APIs will have the same authentication for now.
|
||||
c.OpenAPIConfig.DefaultSecurity = []map[string][]string{}
|
||||
keys := []string{}
|
||||
@ -387,7 +388,9 @@ func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedCo
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure we populate info, and info.version, if not manually set
|
||||
if c.OpenAPIConfig.Info == nil {
|
||||
c.OpenAPIConfig.Info = &spec.Info{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user