Commit 27c77567 authored by Satnam Singh's avatar Satnam Singh

Merge pull request #5342 from nikhiljindal/masterUrl

Adding http:// prefix to the swagger WebServicesURL to prevent basePath validation errors
parents 19b6c85f 8c3f728a
{
"swaggerVersion": "1.2",
"apiVersion": "",
"basePath": "127.0.0.1:6443",
"basePath": "https://127.0.0.1:6443",
"resourcePath": "/api",
"apis": [
{
......
......@@ -2,14 +2,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": "",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"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/",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment