fix devops go vet (#1928)
Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright 2019 The KubeSphere Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
*/
|
||||
|
||||
package install
|
||||
|
||||
import (
|
||||
"github.com/emicklei/go-restful"
|
||||
urlruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/runtime"
|
||||
"kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Install(runtime.Container)
|
||||
}
|
||||
|
||||
func Install(container *restful.Container) {
|
||||
urlruntime.Must(v1alpha2.AddToContainer(container))
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func Test_NoScmPipelineConfig_Discarder(t *testing.T) {
|
||||
Description: "for test",
|
||||
Jenkinsfile: "node{echo 'hello'}",
|
||||
Discarder: &devops.DiscarderProperty{
|
||||
"3", "5",
|
||||
DaysToKeep: "3", NumToKeep: "5",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -56,7 +56,7 @@ func Test_NoScmPipelineConfig_Discarder(t *testing.T) {
|
||||
Description: "for test",
|
||||
Jenkinsfile: "node{echo 'hello'}",
|
||||
Discarder: &devops.DiscarderProperty{
|
||||
"3", "",
|
||||
DaysToKeep: "3", NumToKeep: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -64,7 +64,7 @@ func Test_NoScmPipelineConfig_Discarder(t *testing.T) {
|
||||
Description: "for test",
|
||||
Jenkinsfile: "node{echo 'hello'}",
|
||||
Discarder: &devops.DiscarderProperty{
|
||||
"", "21321",
|
||||
DaysToKeep: "", NumToKeep: "21321",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -72,7 +72,7 @@ func Test_NoScmPipelineConfig_Discarder(t *testing.T) {
|
||||
Description: "for test",
|
||||
Jenkinsfile: "node{echo 'hello'}",
|
||||
Discarder: &devops.DiscarderProperty{
|
||||
"", "",
|
||||
DaysToKeep: "", NumToKeep: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ func TestFakeS3(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
o, ok := s3.storage["hello"]
|
||||
o, ok := s3.Storage["hello"]
|
||||
if !ok {
|
||||
t.Fatal("should have hello object")
|
||||
}
|
||||
@@ -41,7 +41,7 @@ func TestFakeS3(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, ok = s3.storage["hello"]
|
||||
_, ok = s3.Storage["hello"]
|
||||
if ok {
|
||||
t.Fatal("should not have hello object")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user