Revert "temp"

This reverts commit e4ff1b0bad.
This commit is contained in:
runzexia
2019-08-07 18:01:15 +08:00
parent 8c14d5a444
commit 20df96f978
12 changed files with 7 additions and 422 deletions

View File

@@ -593,19 +593,6 @@ The last one is encrypted info, such as the password of the username-password ty
Returns(http.StatusOK, RespOK, devops.Crumb{}).
Writes(devops.Crumb{}))
webservice.Route(webservice.PUT("/namespaces/{namespace}/s2ibinaries/{s2ibinary}/file").
To(devopsapi.UploadS2iBinary).
Consumes("multipart/form-data").
Produces(restful.MIME_JSON).
Doc("Upload S2iBinary file").
Returns(http.StatusOK, RespOK, devops.Crumb{}))
webservice.Route(webservice.GET("/namespaces/{namespace}/s2ibinaries/{s2ibinary}/file/{file}").
To(devopsapi.DownloadS2iBinary).
Produces(restful.MIME_OCTET).
Doc("Download S2iBinary file").
Returns(http.StatusOK, RespOK, nil))
// TODO are not used in this version. will be added in 2.1.0
//// match /job/init-job/descriptorByName/org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition/checkScriptCompile
//webservice.Route(webservice.POST("/devops/check/scriptcompile").

View File

@@ -1,34 +0,0 @@
package devops
import (
"code.cloudfoundry.org/bytefmt"
"fmt"
"github.com/emicklei/go-restful"
"github.com/golang/glog"
"kubesphere.io/kubesphere/pkg/errors"
"net/http"
)
func UploadS2iBinary(req *restful.Request, resp *restful.Response) {
err := req.Request.ParseMultipartForm(bytefmt.MEGABYTE * 20)
if err != nil {
glog.Errorf("%+v", err)
errors.ParseSvcErr(restful.NewError(http.StatusBadRequest, err.Error()), resp)
return
}
if len(req.Request.MultipartForm.File) == 0 {
err := fmt.Errorf("could not get file from form")
glog.Errorf("%+v", err)
errors.ParseSvcErr(restful.NewError(http.StatusBadRequest, err.Error()), resp)
}
if len(req.Request.MultipartForm.File["binary"]) == 0 {
err := fmt.Errorf("could not get file from form")
glog.Errorf("%+v", err)
errors.ParseSvcErr(restful.NewError(http.StatusBadRequest, err.Error()), resp)
}
}
func DownloadS2iBinary(req *restful.Request, resp *restful.Response) {
}

View File

@@ -1 +0,0 @@
package devops