diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index ceafb729d..24109d44b 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -22,7 +22,7 @@ import ( "github.com/emicklei/go-restful" "github.com/emicklei/go-restful-openapi" "k8s.io/apimachinery/pkg/runtime/schema" - v1alpha1devops "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1" + devopsv1alpha1 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha1" devopsapi "kubesphere.io/kubesphere/pkg/apiserver/devops" "kubesphere.io/kubesphere/pkg/apiserver/runtime" "kubesphere.io/kubesphere/pkg/constants" @@ -622,7 +622,7 @@ The last one is encrypted info, such as the password of the username-password ty Param(webservice.PathParameter("s2ibinary", "the name of s2ibinary")). Param(webservice.FormParameter("s2ibinary", "file to upload")). Param(webservice.FormParameter("md5", "md5 of file")). - Returns(http.StatusOK, RespOK, v1alpha1devops.S2iBinary{})) + Returns(http.StatusOK, RespOK, devopsv1alpha1.S2iBinary{})) webservice.Route(webservice.GET("/namespaces/{namespace}/s2ibinaries/{s2ibinary}/file/{file}"). To(devopsapi.DownloadS2iBinary). @@ -630,6 +630,7 @@ The last one is encrypted info, such as the password of the username-password ty Doc("Download S2iBinary file"). Param(webservice.PathParameter("namespace", "the name of namespaces")). Param(webservice.PathParameter("s2ibinary", "the name of s2ibinary")). + Param(webservice.PathParameter("file","the name of binary file")). Returns(http.StatusOK, RespOK, nil)) // TODO are not used in this version. will be added in 2.1.0 diff --git a/pkg/controller/s2ibinary/s2ibinary_controller.go b/pkg/controller/s2ibinary/s2ibinary_controller.go index b547fea86..4b38ab950 100644 --- a/pkg/controller/s2ibinary/s2ibinary_controller.go +++ b/pkg/controller/s2ibinary/s2ibinary_controller.go @@ -119,7 +119,7 @@ func (c *S2iBinaryController) processNextWorkItem() bool { return fmt.Errorf("error syncing '%s': %s, requeuing", key, err.Error()) } c.workqueue.Forget(obj) - klog.Infof("Successfully synced '%s'", key) + klog.V(5).Infof("Successfully synced '%s'", key) return nil }(obj) @@ -191,7 +191,7 @@ func (c *S2iBinaryController) syncHandler(key string) error { } else { if sliceutil.HasString(s2ibin.ObjectMeta.Finalizers, devopsv1alpha1.S2iBinaryFinalizerName) { - if err := c.DeleteBinaryInS3(s2ibin); err != nil { + if err := c.deleteBinaryInS3(s2ibin); err != nil { klog.Error(err, fmt.Sprintf("failed to delete resource %s in s3", key)) return err } @@ -209,7 +209,7 @@ func (c *S2iBinaryController) syncHandler(key string) error { return nil } -func (c *S2iBinaryController) DeleteBinaryInS3(s2ibin *devopsv1alpha1.S2iBinary) error { +func (c *S2iBinaryController) deleteBinaryInS3(s2ibin *devopsv1alpha1.S2iBinary) error { s3client := s2is3.Client() input := &s3.DeleteObjectInput{ Bucket: s2is3.Bucket(), diff --git a/pkg/controller/s2irun/s2irun_controller.go b/pkg/controller/s2irun/s2irun_controller.go index f8159e89d..ad20ea6e7 100644 --- a/pkg/controller/s2irun/s2irun_controller.go +++ b/pkg/controller/s2irun/s2irun_controller.go @@ -126,7 +126,7 @@ func (c *S2iRunController) processNextWorkItem() bool { return fmt.Errorf("error syncing '%s': %s, requeuing", key, err.Error()) } c.workqueue.Forget(obj) - klog.Infof("Successfully synced '%s'", key) + klog.V(5).Infof("Successfully synced '%s'", key) return nil }(obj) diff --git a/pkg/models/devops/s2ibinary_handler.go b/pkg/models/devops/s2ibinary_handler.go index 8972b06cf..1c7db5cdb 100644 --- a/pkg/models/devops/s2ibinary_handler.go +++ b/pkg/models/devops/s2ibinary_handler.go @@ -22,7 +22,7 @@ import ( ) const ( - GetS2iBinaryURL = "http://ks-apiserver.kubesphere-system.svc/kapis/devops.kubesphere.io/v1alpha2/namespaces/%s/s2ibinaries/%s/file/%s" + GetS2iBinaryURL = "kapis/devops.kubesphere.io/v1alpha2/namespaces/%s/s2ibinaries/%s/file/%s" ) func UploadS2iBinary(namespace, name, md5 string, fileHeader *multipart.FileHeader) (*v1alpha1.S2iBinary, error) {