mirror of https://github.com/k3s-io/k3s
Adding http:// prefix to the swagger WebServicesURL to prevent basePath validation errors
parent
7d53425bbc
commit
8c3f728aa6
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "127.0.0.1:6443",
|
||||
"basePath": "https://127.0.0.1:6443",
|
||||
"resourcePath": "/api",
|
||||
"apis": [
|
||||
{
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apis": [
|
||||
{
|
||||
"path": "/api",
|
||||
"description": "get available API versions"
|
||||
},
|
||||
{
|
||||
"path": "/version",
|
||||
"description": "git code version from which this is built"
|
||||
},
|
||||
{
|
||||
"path": "/api/v1beta1",
|
||||
"description": "API at /api/v1beta1 version v1beta1"
|
||||
|
@ -20,6 +12,14 @@
|
|||
{
|
||||
"path": "/api/v1beta3",
|
||||
"description": "API at /api/v1beta3 version v1beta3"
|
||||
},
|
||||
{
|
||||
"path": "/api",
|
||||
"description": "get available API versions"
|
||||
},
|
||||
{
|
||||
"path": "/version",
|
||||
"description": "git code version from which this is built"
|
||||
}
|
||||
],
|
||||
"apiVersion": "",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "127.0.0.1:6443",
|
||||
"basePath": "https://127.0.0.1:6443",
|
||||
"resourcePath": "/version",
|
||||
"apis": [
|
||||
{
|
||||
|
|
|
@ -519,11 +519,18 @@ func (m *Master) init(c *Config) {
|
|||
// register their own web services into the Kubernetes mux prior to initialization
|
||||
// of swagger, so that other resource types show up in the documentation.
|
||||
func (m *Master) InstallSwaggerAPI() {
|
||||
webServicesUrl := ""
|
||||
// Use the secure read write port, if available.
|
||||
if m.publicReadWritePort != 0 {
|
||||
webServicesUrl = "https://" + net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadWritePort))
|
||||
} else {
|
||||
// Use the read only port.
|
||||
webServicesUrl = "http://" + net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadOnlyPort))
|
||||
}
|
||||
// Enable swagger UI and discovery API
|
||||
swaggerConfig := swagger.Config{
|
||||
WebServicesUrl: net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadWritePort)),
|
||||
WebServices: m.handlerContainer.RegisteredWebServices(),
|
||||
// TODO: Parameterize the path?
|
||||
WebServicesUrl: webServicesUrl,
|
||||
WebServices: m.handlerContainer.RegisteredWebServices(),
|
||||
ApiPath: "/swaggerapi/",
|
||||
SwaggerPath: "/swaggerui/",
|
||||
SwaggerFilePath: "/swagger-ui/",
|
||||
|
|
Loading…
Reference in New Issue