mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-14 06:15:45 +00:00
Merge pull request #5342 from nikhiljindal/masterUrl
Adding http:// prefix to the swagger WebServicesURL to prevent basePath validation errors
This commit is contained in:
commit
27c77567d9
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"swaggerVersion": "1.2",
|
"swaggerVersion": "1.2",
|
||||||
"apiVersion": "",
|
"apiVersion": "",
|
||||||
"basePath": "127.0.0.1:6443",
|
"basePath": "https://127.0.0.1:6443",
|
||||||
"resourcePath": "/api",
|
"resourcePath": "/api",
|
||||||
"apis": [
|
"apis": [
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
{
|
{
|
||||||
"swaggerVersion": "1.2",
|
"swaggerVersion": "1.2",
|
||||||
"apis": [
|
"apis": [
|
||||||
{
|
|
||||||
"path": "/api",
|
|
||||||
"description": "get available API versions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "/version",
|
|
||||||
"description": "git code version from which this is built"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "/api/v1beta1",
|
"path": "/api/v1beta1",
|
||||||
"description": "API at /api/v1beta1 version v1beta1"
|
"description": "API at /api/v1beta1 version v1beta1"
|
||||||
@ -20,6 +12,14 @@
|
|||||||
{
|
{
|
||||||
"path": "/api/v1beta3",
|
"path": "/api/v1beta3",
|
||||||
"description": "API at /api/v1beta3 version 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": "",
|
"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",
|
"swaggerVersion": "1.2",
|
||||||
"apiVersion": "",
|
"apiVersion": "",
|
||||||
"basePath": "127.0.0.1:6443",
|
"basePath": "https://127.0.0.1:6443",
|
||||||
"resourcePath": "/version",
|
"resourcePath": "/version",
|
||||||
"apis": [
|
"apis": [
|
||||||
{
|
{
|
||||||
|
@ -519,11 +519,18 @@ func (m *Master) init(c *Config) {
|
|||||||
// register their own web services into the Kubernetes mux prior to initialization
|
// register their own web services into the Kubernetes mux prior to initialization
|
||||||
// of swagger, so that other resource types show up in the documentation.
|
// of swagger, so that other resource types show up in the documentation.
|
||||||
func (m *Master) InstallSwaggerAPI() {
|
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
|
// Enable swagger UI and discovery API
|
||||||
swaggerConfig := swagger.Config{
|
swaggerConfig := swagger.Config{
|
||||||
WebServicesUrl: net.JoinHostPort(m.publicIP.String(), strconv.Itoa(m.publicReadWritePort)),
|
WebServicesUrl: webServicesUrl,
|
||||||
WebServices: m.handlerContainer.RegisteredWebServices(),
|
WebServices: m.handlerContainer.RegisteredWebServices(),
|
||||||
// TODO: Parameterize the path?
|
|
||||||
ApiPath: "/swaggerapi/",
|
ApiPath: "/swaggerapi/",
|
||||||
SwaggerPath: "/swaggerui/",
|
SwaggerPath: "/swaggerui/",
|
||||||
SwaggerFilePath: "/swagger-ui/",
|
SwaggerFilePath: "/swagger-ui/",
|
||||||
|
Loading…
Reference in New Issue
Block a user