Merge pull request #1890 from wnxn/set-default-sc

Add patch api header
This commit is contained in:
KubeSphere CI Bot
2020-04-29 10:45:27 +08:00
committed by GitHub

View File

@@ -58,6 +58,7 @@ func addWebService(c *restful.Container) error {
webservice := runtime.NewWebService(GroupVersion)
ok := "ok"
mimePatch := []string{restful.MIME_JSON, runtime.MimeMergePatchJson, runtime.MimeJsonPatchJson}
webservice.Route(webservice.GET("/namespaces/{namespace}/{resources}").
To(resources.ListNamespacedResources).
@@ -259,6 +260,7 @@ func addWebService(c *restful.Container) error {
To(workloadstatuses.GetNamespacedAbnormalWorkloads))
webservice.Route(webservice.PATCH("/storageclasses/{storageclass}").
Consumes(mimePatch...).
To(resources.PatchStorageClass).
Doc("patch storage class").
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterResourcesTag}).