Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing missing swagger spec for apis/extensions #16690

Merged
merged 2 commits into from Nov 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions api/swagger-spec/apis.json
@@ -0,0 +1,28 @@
{
"swaggerVersion": "1.2",
"apiVersion": "",
"basePath": "https://10.10.10.10:6443",
"resourcePath": "/apis",
"apis": [
{
"path": "/apis",
"description": "get available API versions",
"operations": [
{
"type": "void",
"method": "GET",
"summary": "get available API versions",
"nickname": "getAPIVersions",
"parameters": [],
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
]
}
],
"models": {}
}
28 changes: 28 additions & 0 deletions api/swagger-spec/extensions.json
@@ -0,0 +1,28 @@
{
"swaggerVersion": "1.2",
"apiVersion": "",
"basePath": "https://10.10.10.10:6443",
"resourcePath": "/apis/extensions",
"apis": [
{
"path": "/apis/extensions",
"description": "get information of a group",
"operations": [
{
"type": "void",
"method": "GET",
"summary": "get information of a group",
"nickname": "getAPIGroup",
"parameters": [],
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
]
}
],
"models": {}
}
2 changes: 1 addition & 1 deletion api/swagger-spec/resourceListing.json
Expand Up @@ -14,7 +14,7 @@
"description": "API at /apis/extensions/v1beta1"
},
{
"path": "/apis/extensions/",
"path": "/apis/extensions",
"description": "get information of a group"
},
{
Expand Down
2 changes: 2 additions & 0 deletions hack/after-build/update-swagger-spec.sh
Expand Up @@ -69,6 +69,8 @@ curl -fs ${SWAGGER_API_PATH} > ${SWAGGER_ROOT_DIR}/resourceListing.json
curl -fs ${SWAGGER_API_PATH}version > ${SWAGGER_ROOT_DIR}/version.json
curl -fs ${SWAGGER_API_PATH}api > ${SWAGGER_ROOT_DIR}/api.json
curl -fs ${SWAGGER_API_PATH}api/v1 > ${SWAGGER_ROOT_DIR}/v1.json
curl -fs ${SWAGGER_API_PATH}apis > ${SWAGGER_ROOT_DIR}/apis.json
curl -fs ${SWAGGER_API_PATH}apis/extensions > ${SWAGGER_ROOT_DIR}/extensions.json
curl -fs ${SWAGGER_API_PATH}apis/extensions/v1beta1 > ${SWAGGER_ROOT_DIR}/v1beta1.json

kube::log::status "SUCCESS"
Expand Down
2 changes: 1 addition & 1 deletion pkg/master/master.go
Expand Up @@ -672,7 +672,7 @@ func (m *Master) init(c *Config) {
Versions: expAPIVersions,
PreferredVersion: unversioned.GroupVersion{GroupVersion: storageVersion, Version: apiutil.GetVersion(storageVersion)},
}
apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group+"/", group)
apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group, group)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhiljindal, this seems unrelated to /swaggerapi/...? This should only affect /apis/extensions/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/swaggerapi is auto generated.
/swaggerapi/apis/extensions/ was returning ApiDeclaration not found. This change fixes that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Maybe go-restful requires there's no trailing "/". Could you double check /apis/extensions/ and /apis/extensions still work? Because that's the paths directly affected by this line. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhiljindal, Could you double check /apis/extensions/ and /apis/extensions still work? Because that's the paths directly affected by this line. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Verified that both of them work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

allGroups = append(allGroups, group)
apiserver.InstallServiceErrorHandler(m.handlerContainer, m.newRequestInfoResolver(), []string{expVersion.Version})
}
Expand Down