From f2ba29fe14029f0282f1354698ec53e3e3a886da Mon Sep 17 00:00:00 2001 From: hongming Date: Wed, 3 Jul 2019 15:03:15 +0800 Subject: [PATCH 1/3] update job rerun api Signed-off-by: hongming --- pkg/apis/operations/v1alpha2/register.go | 6 +++--- pkg/apis/resources/v1alpha2/register.go | 2 +- pkg/apiserver/operations/job.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/apis/operations/v1alpha2/register.go b/pkg/apis/operations/v1alpha2/register.go index 3151a466e..171f3db55 100644 --- a/pkg/apis/operations/v1alpha2/register.go +++ b/pkg/apis/operations/v1alpha2/register.go @@ -49,11 +49,11 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/namespaces/{namespace}/jobs/{job}"). To(operations.RerunJob). - Doc("Job rerun"). + Doc("Rerun job whether the job is complete or not"). Deprecate(). Param(webservice.PathParameter("job", "job name")). - Param(webservice.PathParameter("namespace", "job's namespace")). - Param(webservice.QueryParameter("a", "action")). + Param(webservice.PathParameter("namespace", "the namespace where the job runs in")). + Param(webservice.QueryParameter("action", "action must be \"rerun\"")). Returns(http.StatusOK, ok, errors.Error{})) c.Add(webservice) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index bbb4fa760..f7454dab6 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -83,7 +83,7 @@ func addWebService(c *restful.Container) error { Doc("Rerun job whether the job is complete or not"). Param(webservice.PathParameter("job", "job name")). Param(webservice.PathParameter("namespace", "the namespace where the job runs in")). - Param(webservice.QueryParameter("a", "action")). + Param(webservice.QueryParameter("action", "action must be \"rerun\"")). Returns(http.StatusOK, ok, errors.Error{})) webservice.Route(webservice.GET("/{resources}"). diff --git a/pkg/apiserver/operations/job.go b/pkg/apiserver/operations/job.go index e87411030..cd0436e47 100644 --- a/pkg/apiserver/operations/job.go +++ b/pkg/apiserver/operations/job.go @@ -33,7 +33,7 @@ func RerunJob(req *restful.Request, resp *restful.Response) { job := req.PathParameter("job") namespace := req.PathParameter("namespace") - action := req.QueryParameter("a") + action := req.QueryParameter("action") switch action { case "rerun": From e062d11fef7144119330d45b8c2242737706bd4b Mon Sep 17 00:00:00 2001 From: rayzhou2017 Date: Wed, 3 Jul 2019 17:08:31 +0800 Subject: [PATCH 2/3] Update register.go --- pkg/apis/operations/v1alpha2/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/operations/v1alpha2/register.go b/pkg/apis/operations/v1alpha2/register.go index 171f3db55..5b7611e05 100644 --- a/pkg/apis/operations/v1alpha2/register.go +++ b/pkg/apis/operations/v1alpha2/register.go @@ -52,7 +52,7 @@ func addWebService(c *restful.Container) error { Doc("Rerun job whether the job is complete or not"). Deprecate(). Param(webservice.PathParameter("job", "job name")). - Param(webservice.PathParameter("namespace", "the namespace where the job runs in")). + Param(webservice.PathParameter("namespace", "the name of the namespace where the job runs in")). Param(webservice.QueryParameter("action", "action must be \"rerun\"")). Returns(http.StatusOK, ok, errors.Error{})) From b95956e1ed53450b145c51051bd9ee2a17d8ba34 Mon Sep 17 00:00:00 2001 From: rayzhou2017 Date: Wed, 3 Jul 2019 17:09:37 +0800 Subject: [PATCH 3/3] Update register.go --- pkg/apis/resources/v1alpha2/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index f7454dab6..df59250a6 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -82,7 +82,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). Doc("Rerun job whether the job is complete or not"). Param(webservice.PathParameter("job", "job name")). - Param(webservice.PathParameter("namespace", "the namespace where the job runs in")). + Param(webservice.PathParameter("namespace", "the name of the namespace where the job runs in")). Param(webservice.QueryParameter("action", "action must be \"rerun\"")). Returns(http.StatusOK, ok, errors.Error{}))