mirror of https://github.com/k3s-io/k3s
Merge pull request #77980 from SataQiu/fix-golint-test-20190516
Fix golint failures of test/e2ek3s-v1.15.3
commit
46a80259f6
|
@ -590,7 +590,6 @@ staging/src/k8s.io/sample-apiserver/pkg/apis/wardle
|
|||
staging/src/k8s.io/sample-apiserver/pkg/apis/wardle/v1alpha1
|
||||
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer
|
||||
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder
|
||||
test/e2e
|
||||
test/e2e/autoscaling
|
||||
test/e2e/chaosmonkey
|
||||
test/e2e/common
|
||||
|
|
|
@ -34,7 +34,7 @@ import (
|
|||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
"k8s.io/kubernetes/test/e2e/framework/testfiles"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
"github.com/onsi/ginkgo"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -46,7 +46,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
|
||||
var c clientset.Interface
|
||||
var ns string
|
||||
BeforeEach(func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
c = f.ClientSet
|
||||
ns = f.Namespace.Name
|
||||
|
||||
|
@ -63,7 +63,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
})
|
||||
|
||||
framework.KubeDescribe("Liveness", func() {
|
||||
It("liveness pods should be automatically restarted", func() {
|
||||
ginkgo.It("liveness pods should be automatically restarted", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/liveness"
|
||||
execYaml := readFile(test, "exec-liveness.yaml.in")
|
||||
httpYaml := readFile(test, "http-liveness.yaml.in")
|
||||
|
@ -94,7 +94,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
wg.Done()
|
||||
}
|
||||
|
||||
By("Check restarts")
|
||||
ginkgo.By("Check restarts")
|
||||
|
||||
// Start the "actual test", and wait for both pods to complete.
|
||||
// If 2 fail: Something is broken with the test (or maybe even with liveness).
|
||||
|
@ -111,7 +111,7 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
})
|
||||
|
||||
framework.KubeDescribe("Secret", func() {
|
||||
It("should create a pod that reads a secret", func() {
|
||||
ginkgo.It("should create a pod that reads a secret", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/secrets"
|
||||
secretYaml := readFile(test, "secret.yaml")
|
||||
podYaml := readFile(test, "secret-pod.yaml.in")
|
||||
|
@ -119,31 +119,31 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||
podName := "secret-test-pod"
|
||||
|
||||
By("creating secret and pod")
|
||||
ginkgo.By("creating secret and pod")
|
||||
framework.RunKubectlOrDieInput(secretYaml, "create", "-f", "-", nsFlag)
|
||||
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
|
||||
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
By("checking if secret was read correctly")
|
||||
ginkgo.By("checking if secret was read correctly")
|
||||
_, err = framework.LookForStringInLog(ns, "secret-test-pod", "test-container", "value-1", serverStartTimeout)
|
||||
framework.ExpectNoError(err)
|
||||
})
|
||||
})
|
||||
|
||||
framework.KubeDescribe("Downward API", func() {
|
||||
It("should create a pod that prints his name and namespace", func() {
|
||||
ginkgo.It("should create a pod that prints his name and namespace", func() {
|
||||
test := "test/fixtures/doc-yaml/user-guide/downward-api"
|
||||
podYaml := readFile(test, "dapi-pod.yaml.in")
|
||||
nsFlag := fmt.Sprintf("--namespace=%v", ns)
|
||||
podName := "dapi-test-pod"
|
||||
|
||||
By("creating the pod")
|
||||
ginkgo.By("creating the pod")
|
||||
framework.RunKubectlOrDieInput(podYaml, "create", "-f", "-", nsFlag)
|
||||
err := framework.WaitForPodNoLongerRunningInNamespace(c, podName, ns)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
By("checking if name and namespace were passed correctly")
|
||||
ginkgo.By("checking if name and namespace were passed correctly")
|
||||
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAMESPACE=%v", ns), serverStartTimeout)
|
||||
framework.ExpectNoError(err)
|
||||
_, err = framework.LookForStringInLog(ns, podName, "test-container", fmt.Sprintf("MY_POD_NAME=%v", podName), serverStartTimeout)
|
||||
|
@ -154,5 +154,5 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
|||
|
||||
func readFile(test, file string) string {
|
||||
from := filepath.Join(test, file)
|
||||
return commonutils.SubstituteImageName(string(testfiles.ReadOrDie(from, Fail)))
|
||||
return commonutils.SubstituteImageName(string(testfiles.ReadOrDie(from, ginkgo.Fail)))
|
||||
}
|
||||
|
|
|
@ -26,18 +26,18 @@ import (
|
|||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
"github.com/onsi/ginkgo"
|
||||
)
|
||||
|
||||
var _ = framework.KubeDescribe("GKE local SSD [Feature:GKELocalSSD]", func() {
|
||||
|
||||
f := framework.NewDefaultFramework("localssd")
|
||||
|
||||
BeforeEach(func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
framework.SkipUnlessProviderIs("gke")
|
||||
})
|
||||
|
||||
It("should write and read from node local SSD [Feature:GKELocalSSD]", func() {
|
||||
ginkgo.It("should write and read from node local SSD [Feature:GKELocalSSD]", func() {
|
||||
e2elog.Logf("Start local SSD test")
|
||||
createNodePoolWithLocalSsds("np-ssd")
|
||||
doTestWriteAndReadToLocalSsd(f)
|
||||
|
|
|
@ -23,18 +23,18 @@ import (
|
|||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
"github.com/onsi/ginkgo"
|
||||
)
|
||||
|
||||
var _ = framework.KubeDescribe("GKE node pools [Feature:GKENodePool]", func() {
|
||||
|
||||
f := framework.NewDefaultFramework("node-pools")
|
||||
|
||||
BeforeEach(func() {
|
||||
ginkgo.BeforeEach(func() {
|
||||
framework.SkipUnlessProviderIs("gke")
|
||||
})
|
||||
|
||||
It("should create a cluster with multiple node pools [Feature:GKENodePool]", func() {
|
||||
ginkgo.It("should create a cluster with multiple node pools [Feature:GKENodePool]", func() {
|
||||
e2elog.Logf("Start create node pool test")
|
||||
testCreateDeleteNodePool(f, "test-pool")
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue