From 5fde0d307656a430519a8e7a9650e16560e882f0 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Thu, 9 Aug 2018 19:53:20 -0400 Subject: [PATCH] Revamp nfs e2e tests to fork k8s instead of vendoring it and use yamls --- .travis.yml | 4 +- .../deploy/rbac/clusterrolebinding.yaml | 1 - .../manifests/rbac/clusterrolebinding.yaml | 1 - nfs/Makefile | 3 +- nfs/deploy/kubernetes/class.yaml | 2 + nfs/deploy/kubernetes/deployment.yaml | 2 +- nfs/deploy/kubernetes/rbac.yaml | 1 - nfs/deploy/kubernetes/read-pod.yaml | 22 + nfs/deploy/kubernetes/statefulset.yaml | 9 +- .../{write_pod.yaml => write-pod.yaml} | 0 nfs/test/e2e/.gitignore | 1 + nfs/test/e2e/e2e_suite_test.go | 35 - nfs/test/e2e/e2e_test.go | 468 +---------- nfs/test/e2e/glide.lock | 779 ------------------ nfs/test/e2e/glide.yaml | 166 ---- nfs/test/e2e/nfs.go | 166 ++++ nfs/test/e2e/test.sh | 65 ++ nfs/test/e2e/testing-manifests | 1 + test.sh | 13 +- 19 files changed, 282 insertions(+), 1457 deletions(-) create mode 100644 nfs/deploy/kubernetes/read-pod.yaml rename nfs/deploy/kubernetes/{write_pod.yaml => write-pod.yaml} (100%) delete mode 100644 nfs/test/e2e/e2e_suite_test.go delete mode 100644 nfs/test/e2e/glide.lock delete mode 100644 nfs/test/e2e/glide.yaml create mode 100644 nfs/test/e2e/nfs.go create mode 100755 nfs/test/e2e/test.sh create mode 120000 nfs/test/e2e/testing-manifests diff --git a/.travis.yml b/.travis.yml index c17b058cc04..bbf3b8c369c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ env: - TEST_SUITE=osx - TEST_SUITE=linux-local-volume - TEST_SUITE=linux-everything-else - - TEST_SUITE=linux-nfs ETCD_VER=v3.0.14 KUBE_VERSION=1.5.4 - - TEST_SUITE=linux-nfs ETCD_VER=v3.0.17 KUBE_VERSION=1.6.0 +# - TEST_SUITE=linux-nfs ETCD_VER=v3.0.14 KUBE_VERSION=1.5.4 + - TEST_SUITE=linux-nfs ETCD_VER=v3.2.18 KUBE_VERSION=1.11.2 before_install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ulimit -n 8192; fi diff --git a/ceph/cephfs/deploy/rbac/clusterrolebinding.yaml b/ceph/cephfs/deploy/rbac/clusterrolebinding.yaml index 9b24b01d34c..516628b5a2d 100644 --- a/ceph/cephfs/deploy/rbac/clusterrolebinding.yaml +++ b/ceph/cephfs/deploy/rbac/clusterrolebinding.yaml @@ -2,7 +2,6 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: cephfs-provisioner - namespace: cephfs subjects: - kind: ServiceAccount name: cephfs-provisioner diff --git a/digitalocean/manifests/rbac/clusterrolebinding.yaml b/digitalocean/manifests/rbac/clusterrolebinding.yaml index 22d7e7c56d8..fab8e4556ac 100644 --- a/digitalocean/manifests/rbac/clusterrolebinding.yaml +++ b/digitalocean/manifests/rbac/clusterrolebinding.yaml @@ -2,7 +2,6 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: digitalocean-provisioner - namespace: kube-system subjects: - kind: ServiceAccount name: digitalocean-provisioner diff --git a/nfs/Makefile b/nfs/Makefile index 0f439602b46..ee415b5103b 100644 --- a/nfs/Makefile +++ b/nfs/Makefile @@ -46,8 +46,7 @@ test: .PHONY: test test-e2e: - cd ./test/e2e; glide install -v - go test ./test/e2e -v --kubeconfig=$(HOME)/.kube/config + cd ./test/e2e; ./test.sh .PHONY: test-e2e clean: diff --git a/nfs/deploy/kubernetes/class.yaml b/nfs/deploy/kubernetes/class.yaml index 7cf1ac935b7..6ea74350d23 100644 --- a/nfs/deploy/kubernetes/class.yaml +++ b/nfs/deploy/kubernetes/class.yaml @@ -3,3 +3,5 @@ apiVersion: storage.k8s.io/v1 metadata: name: example-nfs provisioner: example.com/nfs +parameters: + mountOptions: "vers=4.1" # TODO: reconcile with StorageClass.mountOptions diff --git a/nfs/deploy/kubernetes/deployment.yaml b/nfs/deploy/kubernetes/deployment.yaml index 977f062125b..3607e4bd3e9 100644 --- a/nfs/deploy/kubernetes/deployment.yaml +++ b/nfs/deploy/kubernetes/deployment.yaml @@ -24,7 +24,7 @@ spec: app: nfs-provisioner --- kind: Deployment -apiVersion: extensions/v1beta1 +apiVersion: extensions/v1 metadata: name: nfs-provisioner spec: diff --git a/nfs/deploy/kubernetes/rbac.yaml b/nfs/deploy/kubernetes/rbac.yaml index 8ae4657a3ca..4f6f275d81e 100644 --- a/nfs/deploy/kubernetes/rbac.yaml +++ b/nfs/deploy/kubernetes/rbac.yaml @@ -30,7 +30,6 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: run-nfs-provisioner - namespace: default subjects: - kind: ServiceAccount name: nfs-provisioner diff --git a/nfs/deploy/kubernetes/read-pod.yaml b/nfs/deploy/kubernetes/read-pod.yaml new file mode 100644 index 00000000000..31497e90f10 --- /dev/null +++ b/nfs/deploy/kubernetes/read-pod.yaml @@ -0,0 +1,22 @@ +kind: Pod +apiVersion: v1 +metadata: + name: read-pod +spec: + containers: + - name: read-pod + image: gcr.io/google_containers/busybox:1.24 + command: + - "/bin/sh" + args: + - "-c" + - "test -f /mnt/SUCCESS && exit 0 || exit 1" + volumeMounts: + - name: nfs-pvc + mountPath: "/mnt" + restartPolicy: "Never" + volumes: + - name: nfs-pvc + persistentVolumeClaim: + claimName: nfs + diff --git a/nfs/deploy/kubernetes/statefulset.yaml b/nfs/deploy/kubernetes/statefulset.yaml index dfdaa5f8efd..f5582e25b04 100644 --- a/nfs/deploy/kubernetes/statefulset.yaml +++ b/nfs/deploy/kubernetes/statefulset.yaml @@ -24,21 +24,22 @@ spec: app: nfs-provisioner --- kind: StatefulSet -apiVersion: apps/v1beta1 +apiVersion: apps/v1 metadata: name: nfs-provisioner spec: + selector: + matchLabels: + app: nfs-provisioner serviceName: "nfs-provisioner" replicas: 1 template: metadata: labels: app: nfs-provisioner - annotations: - pod.alpha.kubernetes.io/initialized: "true" spec: serviceAccount: nfs-provisioner - terminationGracePeriodSeconds: 0 + terminationGracePeriodSeconds: 10 containers: - name: nfs-provisioner image: quay.io/kubernetes_incubator/nfs-provisioner:latest diff --git a/nfs/deploy/kubernetes/write_pod.yaml b/nfs/deploy/kubernetes/write-pod.yaml similarity index 100% rename from nfs/deploy/kubernetes/write_pod.yaml rename to nfs/deploy/kubernetes/write-pod.yaml diff --git a/nfs/test/e2e/.gitignore b/nfs/test/e2e/.gitignore index 61ead86667c..df1349a7cbe 100644 --- a/nfs/test/e2e/.gitignore +++ b/nfs/test/e2e/.gitignore @@ -1 +1,2 @@ /vendor +/src \ No newline at end of file diff --git a/nfs/test/e2e/e2e_suite_test.go b/nfs/test/e2e/e2e_suite_test.go deleted file mode 100644 index a518a2a287b..00000000000 --- a/nfs/test/e2e/e2e_suite_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2016 The Kubernetes 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 e2e - -import ( - "k8s.io/kubernetes/test/e2e/framework" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func init() { - framework.ViperizeFlags() -} - -func TestE2e(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "E2e Suite") -} diff --git a/nfs/test/e2e/e2e_test.go b/nfs/test/e2e/e2e_test.go index e2de19bbf5d..4e7de2ecb9c 100644 --- a/nfs/test/e2e/e2e_test.go +++ b/nfs/test/e2e/e2e_test.go @@ -1,5 +1,5 @@ /* -Copyright 2016 The Kubernetes Authors. +Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,470 +17,18 @@ limitations under the License. package e2e import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "path" - "strings" - "time" + "testing" - "github.com/opencontainers/runc/libcontainer/selinux" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - utilyaml "k8s.io/apimachinery/pkg/util/yaml" - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/v1" - extensions "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" - "k8s.io/kubernetes/pkg/apis/storage/v1beta1" - "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/test/e2e/framework" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" + // test sources + _ "k8s.io/kubernetes/test/e2e/storage" ) -// StorageClassAnnotation represents the storage class associated with a resource. -// It currently matches the Beta value and can change when official is set. -// - in PersistentVolumeClaim it represents required class to match. -// Only PersistentVolumes with the same class (i.e. annotation with the same -// value) can be bound to the claim. In case no such volume exists, the -// controller will provision a new one using StorageClass instance with -// the same name as the annotation value. -// - in PersistentVolume it represents storage class to which the persistent -// volume belongs. -//TODO: Update this to final annotation value as it matches BetaStorageClassAnnotation for now -const StorageClassAnnotation = "volume.beta.kubernetes.io/storage-class" - -const ( - pluginName = "example.com/nfs" - // Requested size of the volume - requestedSize = "100Mi" - // Expected size of the volume is the same, unlike cloud providers - expectedSize = "100Mi" -) - -func testDynamicProvisioning(client clientset.Interface, claim *v1.PersistentVolumeClaim) { - pv := testCreate(client, claim) - testWrite(client, claim) - testRead(client, claim) - testDelete(client, claim, pv) -} - -func testCreate(client clientset.Interface, claim *v1.PersistentVolumeClaim) *v1.PersistentVolume { - err := framework.WaitForPersistentVolumeClaimPhase(v1.ClaimBound, client, claim.Namespace, claim.Name, framework.Poll, 1*time.Minute) - Expect(err).NotTo(HaveOccurred()) - - By("checking the claim") - // Get new copy of the claim - claim, err = client.CoreV1().PersistentVolumeClaims(claim.Namespace).Get(claim.Name, metav1.GetOptions{}) - Expect(err).NotTo(HaveOccurred()) - - // Get the bound PV - pv, err := client.CoreV1().PersistentVolumes().Get(claim.Spec.VolumeName, metav1.GetOptions{}) - Expect(err).NotTo(HaveOccurred()) - - // Check sizes - expectedCapacity := resource.MustParse(expectedSize) - pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)] - Expect(pvCapacity.Value()).To(Equal(expectedCapacity.Value())) - - requestedCapacity := resource.MustParse(requestedSize) - claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] - Expect(claimCapacity.Value()).To(Equal(requestedCapacity.Value())) - - // Check PV properties - Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(v1.PersistentVolumeReclaimDelete)) - expectedAccessModes := []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce} - Expect(pv.Spec.AccessModes).To(Equal(expectedAccessModes)) - Expect(pv.Spec.ClaimRef.Name).To(Equal(claim.ObjectMeta.Name)) - Expect(pv.Spec.ClaimRef.Namespace).To(Equal(claim.ObjectMeta.Namespace)) - - return pv -} - -// We start two pods, first in testWrite and second in testRead: -// - The first writes 'hello word' to the /mnt/test (= the volume). -// - The second one runs grep 'hello world' on /mnt/test. -// If both succeed, Kubernetes actually allocated something that is -// persistent across pods. -func testWrite(client clientset.Interface, claim *v1.PersistentVolumeClaim) { - By("checking the created volume is writable") - runInPodWithVolume(client, claim.Namespace, claim.Name, "echo 'hello world' > /mnt/test/data") - - // Unlike cloud providers, kubelet should unmount NFS quickly - By("Sleeping to let kubelet destroy all pods") - time.Sleep(5 * time.Second) -} - -func testRead(client clientset.Interface, claim *v1.PersistentVolumeClaim) { - By("checking the created volume is readable and retains data") - runInPodWithVolume(client, claim.Namespace, claim.Name, "grep 'hello world' /mnt/test/data") - - // Unlike cloud providers, kubelet should unmount NFS quickly - By("Sleeping to let kubelet destroy all pods") - time.Sleep(5 * time.Second) -} - -func testDelete(client clientset.Interface, claim *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) { - By("deleting the claim") - framework.ExpectNoError(client.CoreV1().PersistentVolumeClaims(claim.Namespace).Delete(claim.Name, nil)) - - // Wait for the PV to get deleted too. - framework.ExpectNoError(framework.WaitForPersistentVolumeDeleted(client, pv.Name, 5*time.Second, 1*time.Minute)) -} - -var _ = framework.KubeDescribe("Volumes [Feature:Volumes]", func() { - f := framework.NewDefaultFramework("volume") - // filled in BeforeEach - var c clientset.Interface - var ns string - var pod *v1.Pod - - BeforeEach(func() { - c = f.ClientSet - ns = f.Namespace.Name - }) - - framework.KubeDescribe("Out-of-tree DynamicProvisioner nfs-provisioner", func() { - AfterEach(func() { - logs, err := framework.GetPodLogs(c, ns, pod.Name, pod.Spec.Containers[0].Name) - if err != nil { - framework.Logf("Error getting pod logs: %v", err) - } else { - framework.Logf("Pod logs:\n%s", logs) - } - }) - - It("should create and delete persistent volumes [Slow]", func() { - By("creating an out-of-tree dynamic provisioner pod") - pod = startProvisionerPod(c, ns) - defer c.Core().Pods(ns).Delete(pod.Name, nil) - - By("creating a StorageClass") - class := newStorageClass() - _, err := c.Storage().StorageClasses().Create(class) - defer c.Storage().StorageClasses().Delete(class.Name, nil) - Expect(err).NotTo(HaveOccurred()) - - By("creating a claim with a dynamic provisioning annotation") - claim := newClaim(ns) - defer func() { - c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil) - }() - claim, err = c.Core().PersistentVolumeClaims(ns).Create(claim) - Expect(err).NotTo(HaveOccurred()) - - testDynamicProvisioning(c, claim) - }) - It("should survive a restart [Slow]", func() { - By("creating an out-of-tree dynamic provisioner deployment of 1 replica") - service, deployment := startProvisionerDeployment(c, ns) - defer c.Extensions().Deployments(ns).Delete(deployment.Name, nil) - defer c.Core().Services(ns).Delete(service.Name, nil) - pod = getDeploymentPod(c, ns, labels.Set(deployment.Spec.Selector.MatchLabels).String()) - - By("creating a StorageClass") - class := newStorageClass() - _, err := c.Storage().StorageClasses().Create(class) - defer c.Storage().StorageClasses().Delete(class.Name, nil) - Expect(err).NotTo(HaveOccurred()) - - By("creating a claim with a dynamic provisioning annotation") - claim := newClaim(ns) - defer func() { - c.Core().PersistentVolumeClaims(ns).Delete(claim.Name, nil) - }() - claim, err = c.Core().PersistentVolumeClaims(ns).Create(claim) - Expect(err).NotTo(HaveOccurred()) - - pv := testCreate(c, claim) - testWrite(c, claim) - testRead(c, claim) - - By("scaling the deployment down to 0 then back to 1") - // err = framework.ScaleDeployment(c, ns, deployment.Name, 0, false) - // Expect(err).NotTo(HaveOccurred()) - scaleDeployment(c, ns, deployment.Name, 0) - scaleDeployment(c, ns, deployment.Name, 1) - pod = getDeploymentPod(c, ns, labels.Set(deployment.Spec.Selector.MatchLabels).String()) - - testRead(c, claim) - testDelete(c, claim, pv) - }) - - }) -}) - -func newClaim(ns string) *v1.PersistentVolumeClaim { - claim := v1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "pvc-", - Namespace: ns, - }, - Spec: v1.PersistentVolumeClaimSpec{ - AccessModes: []v1.PersistentVolumeAccessMode{ - v1.ReadWriteOnce, - }, - Resources: v1.ResourceRequirements{ - Requests: v1.ResourceList{ - v1.ResourceName(v1.ResourceStorage): resource.MustParse(requestedSize), - }, - }, - }, - } - - claim.Annotations = map[string]string{ - StorageClassAnnotation: "fast", - } - - return &claim -} - -// runInPodWithVolume runs a command in a pod with given claim mounted to /mnt directory. -func runInPodWithVolume(c clientset.Interface, ns, claimName, command string) { - pod := &v1.Pod{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pod", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "pvc-volume-tester-", - }, - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "volume-tester", - Image: "gcr.io/google_containers/busybox:1.24", - Command: []string{"/bin/sh"}, - Args: []string{"-c", command}, - VolumeMounts: []v1.VolumeMount{ - { - Name: "my-volume", - MountPath: "/mnt/test", - }, - }, - }, - }, - RestartPolicy: v1.RestartPolicyNever, - Volumes: []v1.Volume{ - { - Name: "my-volume", - VolumeSource: v1.VolumeSource{ - PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{ - ClaimName: claimName, - ReadOnly: false, - }, - }, - }, - }, - }, - } - pod, err := c.Core().Pods(ns).Create(pod) - defer func() { - framework.ExpectNoError(c.Core().Pods(ns).Delete(pod.Name, nil)) - }() - framework.ExpectNoError(err, "Failed to create pod: %v", err) - framework.ExpectNoError(framework.WaitForPodSuccessInNamespace(c, pod.Name, pod.Namespace)) -} - -func newStorageClass() *v1beta1.StorageClass { - return &v1beta1.StorageClass{ - TypeMeta: metav1.TypeMeta{ - Kind: "StorageClass", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "fast", - }, - Provisioner: pluginName, - } -} - -func startProvisionerPod(c clientset.Interface, ns string) *v1.Pod { - podClient := c.Core().Pods(ns) - - provisionerPod := &v1.Pod{ - TypeMeta: metav1.TypeMeta{ - Kind: "Pod", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "nfs-provisioner", - Labels: map[string]string{ - "role": "nfs-provisioner", - }, - }, - - Spec: v1.PodSpec{ - Containers: []v1.Container{ - { - Name: "nfs-provisioner", - Image: "quay.io/kubernetes_incubator/nfs-provisioner:latest", - SecurityContext: &v1.SecurityContext{ - Capabilities: &v1.Capabilities{ - Add: []v1.Capability{"DAC_READ_SEARCH", "SYS_RESOURCE"}, - }, - }, - Args: []string{ - fmt.Sprintf("-provisioner=%s", pluginName), - "-grace-period=0", - }, - Ports: []v1.ContainerPort{ - {Name: "nfs", ContainerPort: 2049}, - {Name: "mountd", ContainerPort: 20048}, - {Name: "rpcbind", ContainerPort: 111}, - {Name: "rpcbind-udp", ContainerPort: 111, Protocol: v1.ProtocolUDP}, - }, - Env: []v1.EnvVar{ - { - Name: "POD_IP", - ValueFrom: &v1.EnvVarSource{ - FieldRef: &v1.ObjectFieldSelector{ - FieldPath: "status.podIP", - }, - }, - }, - }, - ImagePullPolicy: v1.PullIfNotPresent, - VolumeMounts: []v1.VolumeMount{ - { - Name: "export-volume", - MountPath: "/export", - }, - }, - }, - }, - Volumes: []v1.Volume{ - { - Name: "export-volume", - VolumeSource: v1.VolumeSource{ - EmptyDir: &v1.EmptyDirVolumeSource{}, - }, - }, - }, - }, - } - provisionerPod, err := podClient.Create(provisionerPod) - framework.ExpectNoError(err, "Failed to create %s pod: %v", provisionerPod.Name, err) - - framework.ExpectNoError(framework.WaitForPodRunningInNamespace(c, provisionerPod)) - - By("locating the provisioner pod") - pod, err := podClient.Get(provisionerPod.Name, metav1.GetOptions{}) - framework.ExpectNoError(err, "Cannot locate the provisioner pod %v: %v", provisionerPod.Name, err) - - By("sleeping a bit to give the provisioner time to start") - time.Sleep(5 * time.Second) - return pod -} - -func startProvisionerDeployment(c clientset.Interface, ns string) (*v1.Service, *extensions.Deployment) { - gopath := os.Getenv("GOPATH") - // TODO - service := svcFromManifest(path.Join(gopath, "src/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml")) - - deployment := deployFromManifest(path.Join(gopath, "src/github.com/kubernetes-incubator/external-storage/nfs/deploy/kubernetes/deployment.yaml")) - - tmpDir, err := ioutil.TempDir("", "nfs-provisioner-deployment") - Expect(err).NotTo(HaveOccurred()) - if selinux.SelinuxEnabled() { - fcon, serr := selinux.Getfilecon(tmpDir) - Expect(serr).NotTo(HaveOccurred()) - context := selinux.NewContext(fcon) - context["type"] = "svirt_sandbox_file_t" - serr = selinux.Chcon(tmpDir, context.Get(), false) - Expect(serr).NotTo(HaveOccurred()) - } - deployment.Spec.Template.Spec.Volumes[0].HostPath.Path = tmpDir - deployment.Spec.Template.Spec.Containers[0].Image = "quay.io/kubernetes_incubator/nfs-provisioner:latest" - deployment.Spec.Template.Spec.Containers[0].Args = []string{ - fmt.Sprintf("-provisioner=%s", pluginName), - "-grace-period=10", - } - - service, err = c.Core().Services(ns).Create(service) - framework.ExpectNoError(err, "Failed to create %s service: %v", service.Name, err) - - deployment, err = c.Extensions().Deployments(ns).Create(deployment) - framework.ExpectNoError(err, "Failed to create %s deployment: %v", deployment.Name, err) - - framework.ExpectNoError(framework.WaitForDeploymentStatus(c, deployment)) - - By("sleeping a bit to give the provisioner time to start") - time.Sleep(5 * time.Second) - - return service, deployment -} - -func getDeploymentPod(c clientset.Interface, ns, labelSelector string) *v1.Pod { - podList, err := c.CoreV1().Pods(ns).List(metav1.ListOptions{LabelSelector: labelSelector}) - Expect(err).NotTo(HaveOccurred()) - Expect(len(podList.Items)).Should(Equal(1)) - return &podList.Items[0] -} - -// svcFromManifest reads a .json/yaml file and returns the json of the desired -func svcFromManifest(fileName string) *v1.Service { - var service v1.Service - data, err := ioutil.ReadFile(fileName) - Expect(err).NotTo(HaveOccurred()) - - r := ioutil.NopCloser(bytes.NewReader(data)) - decoder := utilyaml.NewDocumentDecoder(r) - var chunk []byte - for { - chunk = make([]byte, len(data)) - _, err = decoder.Read(chunk) - chunk = bytes.Trim(chunk, "\x00") - Expect(err).NotTo(HaveOccurred()) - if strings.Contains(string(chunk), "kind: Service") { - break - } - } - - json, err := utilyaml.ToJSON(chunk) - Expect(err).NotTo(HaveOccurred()) - Expect(runtime.DecodeInto(api.Codecs.UniversalDecoder(), json, &service)).NotTo(HaveOccurred()) - - return &service -} - -// deployFromManifest reads a .json/yaml file and returns the json of the desired -func deployFromManifest(fileName string) *extensions.Deployment { - var deployment extensions.Deployment - data, err := ioutil.ReadFile(fileName) - Expect(err).NotTo(HaveOccurred()) - - r := ioutil.NopCloser(bytes.NewReader(data)) - decoder := utilyaml.NewDocumentDecoder(r) - var chunk []byte - for { - chunk = make([]byte, len(data)) - _, err = decoder.Read(chunk) - chunk = bytes.Trim(chunk, "\x00") - Expect(err).NotTo(HaveOccurred()) - if strings.Contains(string(chunk), "kind: Deployment") { - break - } - } - - json, err := utilyaml.ToJSON(chunk) - Expect(err).NotTo(HaveOccurred()) - Expect(runtime.DecodeInto(api.Codecs.UniversalDecoder(), json, &deployment)).NotTo(HaveOccurred()) - - return &deployment +func init() { + framework.ViperizeFlags() } -func scaleDeployment(c clientset.Interface, ns, name string, newSize int32) { - deployment, err := c.Extensions().Deployments(ns).Get(name, metav1.GetOptions{}) - Expect(err).NotTo(HaveOccurred()) - deployment.Spec.Replicas = &newSize - updatedDeployment, err := c.Extensions().Deployments(ns).Update(deployment) - Expect(err).NotTo(HaveOccurred()) - framework.ExpectNoError(framework.WaitForDeploymentStatus(c, updatedDeployment)) - // Above is not enough. Just sleep to prevent conflict when doing Update. - // kubectl Scaler would be ideal. or WaitForDeploymentStatus - time.Sleep(5 * time.Second) +func TestE2E(t *testing.T) { + RunE2ETests(t) } diff --git a/nfs/test/e2e/glide.lock b/nfs/test/e2e/glide.lock deleted file mode 100644 index 5da81511d11..00000000000 --- a/nfs/test/e2e/glide.lock +++ /dev/null @@ -1,779 +0,0 @@ -hash: 08346c54408b243ce985ff86cc89a9fd0ac71566d55415f51b4014e01c626801 -updated: 2017-08-03T15:41:36.461895401-05:00 -imports: [] -testImports: -- name: bitbucket.org/ww/goautoneg - version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 -- name: cloud.google.com/go - version: 3b1ae45394a234c385be014e9a488f2bb6eef821 - subpackages: - - compute/metadata - - internal -- name: github.com/abbot/go-http-auth - version: c0ef4539dfab4d21c8ef20ba2924f9fc6f186d35 -- name: github.com/aws/aws-sdk-go - version: 63ce630574a5ec05ecd8e8de5cea16332a5a684d - subpackages: - - aws - - aws/awserr - - aws/awsutil - - aws/client - - aws/client/metadata - - aws/corehandlers - - aws/credentials - - aws/credentials/ec2rolecreds - - aws/credentials/endpointcreds - - aws/credentials/stscreds - - aws/defaults - - aws/ec2metadata - - aws/endpoints - - aws/request - - aws/session - - aws/signer/v4 - - private/protocol - - private/protocol/ec2query - - private/protocol/json/jsonutil - - private/protocol/jsonrpc - - private/protocol/query - - private/protocol/query/queryutil - - private/protocol/rest - - private/protocol/restxml - - private/protocol/xml/xmlutil - - private/waiter - - service/autoscaling - - service/ec2 - - service/ecr - - service/elb - - service/route53 - - service/sts -- name: github.com/beorn7/perks - version: 3ac7bf7a47d159a033b107610db8a1b6575507a4 - subpackages: - - quantile -- name: github.com/blang/semver - version: 31b736133b98f26d5e078ec9eb591666edfd091f -- name: github.com/coreos/go-oidc - version: 5644a2f50e2d2d5ba0b474bc5bc55fea1925936d - subpackages: - - http - - jose - - key - - oauth2 - - oidc -- name: github.com/coreos/go-systemd - version: b4a58d95188dd092ae20072bac14cece0e67c388 - subpackages: - - activation - - dbus - - util -- name: github.com/coreos/pkg - version: fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8 - subpackages: - - capnslog - - dlopen - - health - - httputil - - timeutil -- name: github.com/coreos/rkt - version: a83419be28ac626876f94a28b4df2dbc9eac7448 - subpackages: - - api/v1alpha -- name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d - subpackages: - - spew -- name: github.com/dgrijalva/jwt-go - version: 01aeca54ebda6e0fbfafd0a524d234159c05ec20 -- name: github.com/docker/distribution - version: cd27f179f2c10c5d300e6d09025b538c475b0d51 - subpackages: - - digest - - reference -- name: github.com/docker/docker - version: 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d - subpackages: - - pkg/mount - - pkg/symlink - - pkg/term - - pkg/term/winconsole -- name: github.com/docker/engine-api - version: dea108d3aa0c67d7162a3fd8aa65f38a430019fd - subpackages: - - client - - client/transport - - client/transport/cancellable - - types - - types/blkiodev - - types/container - - types/filters - - types/network - - types/reference - - types/registry - - types/strslice - - types/time - - types/versions -- name: github.com/docker/go-connections - version: f549a9393d05688dff0992ef3efd8bbe6c628aeb - subpackages: - - nat - - sockets - - tlsconfig -- name: github.com/docker/go-units - version: f2d77a61e3c169b43402a0a1e84f06daf29b8190 -- name: github.com/docker/spdystream - version: 449fdfce4d962303d702fec724ef0ad181c92528 - subpackages: - - spdy -- name: github.com/emicklei/go-restful - version: 09691a3b6378b740595c1002f40c34dd5f218a22 - subpackages: - - log - - swagger -- name: github.com/exponent-io/jsonpath - version: d6023ce2651d8eafb5c75bb0c7167536102ec9f5 -- name: github.com/fsnotify/fsnotify - version: f12c6236fe7b5cf6bcf30e5935d08cb079d78334 -- name: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee -- name: github.com/go-ini/ini - version: 2e44421e256d82ebbf3d4d4fcabe8930b905eff3 -- name: github.com/go-openapi/jsonpointer - version: 46af16f9f7b149af66e5d1bd010e3574dc06de98 -- name: github.com/go-openapi/jsonreference - version: 13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272 -- name: github.com/go-openapi/spec - version: 6aced65f8501fe1217321abf0749d354824ba2ff -- name: github.com/go-openapi/swag - version: 1d0bd113de87027671077d3c71eb3ac5d7dbba72 -- name: github.com/godbus/dbus - version: c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f -- name: github.com/gogo/protobuf - version: e18d7aa8f8c624c915db340349aad4c49b10d173 - subpackages: - - gogoproto - - proto - - protoc-gen-gogo/descriptor - - sortkeys -- name: github.com/golang/glog - version: 44145f04b68cf362d9c4df2182967c2275eaefed -- name: github.com/golang/groupcache - version: 02826c3e79038b59d737d3b1c0a1d937f71a4433 - subpackages: - - lru -- name: github.com/golang/protobuf - version: c9c7427a2a70d2eb3bafa0ab2dc163e45f143317 - subpackages: - - proto -- name: github.com/google/cadvisor - version: c30a9e7d3642fffb422f08be34a7bbc15d69cdbf - subpackages: - - api - - cache/memory - - client/v2 - - collector - - container - - container/common - - container/docker - - container/libcontainer - - container/raw - - container/rkt - - container/systemd - - devicemapper - - events - - fs - - healthz - - http - - http/mux - - info/v1 - - info/v2 - - machine - - manager - - manager/watcher - - manager/watcher/raw - - manager/watcher/rkt - - metrics - - pages - - pages/static - - storage - - summary - - utils - - utils/cloudinfo - - utils/cpuload - - utils/cpuload/netlink - - utils/docker - - utils/oomparser - - utils/sysfs - - utils/sysinfo - - utils/tail - - validate - - version -- name: github.com/google/gofuzz - version: 44d81051d367757e1c7c6a5a86423ece9afcf63c -- name: github.com/hashicorp/hcl - version: d8c773c4cba11b11539e3d45f93daeaa5dcf1fa1 - subpackages: - - hcl/ast - - hcl/parser - - hcl/scanner - - hcl/strconv - - hcl/token - - json/parser - - json/scanner - - json/token -- name: github.com/howeyc/gopass - version: 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d -- name: github.com/imdario/mergo - version: 6633656539c1639d9d78127b7d47c622b5d7b6dc -- name: github.com/inconshreveable/mousetrap - version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -- name: github.com/jmespath/go-jmespath - version: 3433f3ea46d9f8019119e7dd41274e112a2359a9 -- name: github.com/jonboulle/clockwork - version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982 -- name: github.com/juju/ratelimit - version: 77ed1c8a01217656d2080ad51981f6e99adaa177 -- name: github.com/kr/fs - version: 2788f0dbd16903de03cb8186e5c7d97b69ad387b -- name: github.com/kr/pty - version: f7ee69f31298ecbe5d2b349c711e2547a617d398 -- name: github.com/magiconair/properties - version: 61b492c03cf472e0c6419be5899b8e0dc28b1b88 -- name: github.com/mailru/easyjson - version: d5b7844b561a7bc640052f1b935f7b800330d7e0 - subpackages: - - buffer - - jlexer - - jwriter -- name: github.com/matttproud/golang_protobuf_extensions - version: fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a - subpackages: - - pbutil -- name: github.com/Microsoft/go-winio - version: 8f9387ea7efabb228a981b9c381142be7667967f -- name: github.com/mistifyio/go-zfs - version: 1b4ae6fb4e77b095934d4430860ff202060169f8 -- name: github.com/mitchellh/go-wordwrap - version: ad45545899c7b13c020ea92b2072220eefad42b8 -- name: github.com/mitchellh/mapstructure - version: 740c764bc6149d3f1806231418adb9f52c11bcbf -- name: github.com/onsi/ginkgo - version: 74c678d97c305753605c338c6c78c49ec104b5e7 - subpackages: - - config - - internal/codelocation - - internal/containernode - - internal/failer - - internal/leafnodes - - internal/remote - - internal/spec - - internal/specrunner - - internal/suite - - internal/testingtproxy - - internal/writer - - reporters - - reporters/stenographer - - types -- name: github.com/onsi/gomega - version: d59fa0ac68bb5dd932ee8d24eed631cdd519efc3 - subpackages: - - format - - internal/assertion - - internal/asyncassertion - - internal/oraclematcher - - internal/testingtsupport - - matchers - - matchers/support/goraph/bipartitegraph - - matchers/support/goraph/edge - - matchers/support/goraph/node - - matchers/support/goraph/util - - types -- name: github.com/opencontainers/runc - version: 45c30e75abfd52107b53048004a83165403ad0d1 - subpackages: - - libcontainer - - libcontainer/apparmor - - libcontainer/cgroups - - libcontainer/cgroups/fs - - libcontainer/cgroups/systemd - - libcontainer/configs - - libcontainer/configs/validate - - libcontainer/criurpc - - libcontainer/keys - - libcontainer/label - - libcontainer/seccomp - - libcontainer/selinux - - libcontainer/stacktrace - - libcontainer/system - - libcontainer/user - - libcontainer/utils -- name: github.com/pborman/uuid - version: ca53cad383cad2479bbba7f7a1a05797ec1386e4 -- name: github.com/pelletier/go-buffruneio - version: df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d -- name: github.com/pelletier/go-toml - version: 0049ab3dc4c4c70a9eee23087437b69c0dde2130 -- name: github.com/pkg/errors - version: a22138067af1c4942683050411a841ade67fe1eb -- name: github.com/pkg/sftp - version: 4d0e916071f68db74f8a73926335f809396d6b42 -- name: github.com/prometheus/client_golang - version: e51041b3fa41cece0dca035740ba6411905be473 - subpackages: - - prometheus -- name: github.com/prometheus/client_model - version: fa8ad6fec33561be4280a8f0514318c79d7f6cb6 - subpackages: - - go -- name: github.com/prometheus/common - version: ffe929a3f4c4faeaa10f2b9535c2b1be3ad15650 - subpackages: - - expfmt - - model -- name: github.com/prometheus/procfs - version: 454a56f35412459b5e684fd5ec0f9211b94f002a -- name: github.com/PuerkitoBio/purell - version: 8a290539e2e8629dbc4e6bad948158f790ec31f4 -- name: github.com/PuerkitoBio/urlesc - version: 5bd2802263f21d8788851d5305584c82a5c75d7e -- name: github.com/seccomp/libseccomp-golang - version: 32f571b70023028bd57d9288c20efbcb237f3ce0 -- name: github.com/Sirupsen/logrus - version: 26709e2714106fb8ad40b773b711ebce25b78914 -- name: github.com/spf13/afero - version: b28a7effac979219c2a2ed6205a4d70e4b1bcd02 - subpackages: - - mem - - sftp -- name: github.com/spf13/cast - version: e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63 -- name: github.com/spf13/cobra - version: f62e98d28ab7ad31d707ba837a966378465c7b57 - subpackages: - - doc -- name: github.com/spf13/jwalterweatherman - version: 33c24e77fb80341fe7130ee7c594256ff08ccc46 -- name: github.com/spf13/pflag - version: 9ff6c6923cfffbcd502984b8e0c80539a94968b7 -- name: github.com/spf13/viper - version: 7fb2782df3d83e0036cc89f461ed0422628776f4 -- name: github.com/syndtr/gocapability - version: e7cb7fa329f456b3855136a2642b197bad7366ba - subpackages: - - capability -- name: github.com/ugorji/go - version: ded73eae5db7e7a0ef6f55aace87a2873c5d2b74 - subpackages: - - codec - - codec/codecgen -- name: github.com/vishvananda/netlink - version: 1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270 - subpackages: - - nl -- name: golang.org/x/crypto - version: d172538b2cfce0c13cee31e647d0367aa8cd2486 - subpackages: - - bcrypt - - blowfish - - curve25519 - - ed25519 - - ed25519/internal/edwards25519 - - pkcs12 - - pkcs12/internal/rc2 - - ssh - - ssh/terminal -- name: golang.org/x/exp - version: 292a51b8d262487dab23a588950e8052d63d9113 - subpackages: - - inotify -- name: golang.org/x/net - version: e90d6d0afc4c315a0d87a568ae68577cc15149a0 - subpackages: - - context - - context/ctxhttp - - html - - html/atom - - http2 - - http2/hpack - - idna - - internal/timeseries - - lex/httplex - - proxy - - trace - - websocket -- name: golang.org/x/oauth2 - version: 3c3a985cb79f52a3190fbc056984415ca6763d01 - subpackages: - - google - - internal - - jws - - jwt -- name: golang.org/x/sys - version: 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9 - subpackages: - - unix -- name: golang.org/x/text - version: 2910a502d2bf9e43193af9d68ca516529614eed3 - subpackages: - - cases - - encoding - - encoding/internal - - encoding/internal/identifier - - encoding/unicode - - internal/tag - - internal/utf8internal - - language - - runes - - secure/bidirule - - secure/precis - - transform - - unicode/bidi - - unicode/norm - - width -- name: google.golang.org/api - version: 55146ba61254fdb1c26d65ff3c04bc1611ad73fb - subpackages: - - cloudmonitoring/v2beta2 - - compute/v1 - - container/v1 - - dns/v1 - - gensupport - - googleapi - - googleapi/internal/uritemplates -- name: google.golang.org/appengine - version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05 - subpackages: - - internal - - internal/app_identity - - internal/base - - internal/datastore - - internal/log - - internal/modules - - internal/remote_api - - internal/urlfetch - - urlfetch -- name: google.golang.org/grpc - version: 231b4cfea0e79843053a33f5fe90bd4d84b23cd3 - subpackages: - - codes - - credentials - - grpclog - - internal - - metadata - - naming - - peer - - transport -- name: gopkg.in/gcfg.v1 - version: 083575c3955c85df16fe9590cceab64d03f5eb6e - subpackages: - - scanner - - token - - types -- name: gopkg.in/inf.v0 - version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4 -- name: gopkg.in/yaml.v2 - version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 -- name: k8s.io/apimachinery - version: d3c1641d0c440b4c1bef7e1fc105f19f713477e0 - subpackages: - - pkg/api/equality - - pkg/api/errors - - pkg/api/meta - - pkg/api/resource - - pkg/api/validation - - pkg/apimachinery - - pkg/apimachinery/announced - - pkg/apimachinery/registered - - pkg/apis/meta/v1 - - pkg/apis/meta/v1/unstructured - - pkg/apis/meta/v1/validation - - pkg/conversion - - pkg/conversion/queryparams - - pkg/fields - - pkg/labels - - pkg/openapi - - pkg/runtime - - pkg/runtime/schema - - pkg/runtime/serializer - - pkg/runtime/serializer/json - - pkg/runtime/serializer/protobuf - - pkg/runtime/serializer/recognizer - - pkg/runtime/serializer/streaming - - pkg/runtime/serializer/versioning - - pkg/selection - - pkg/types - - pkg/util/diff - - pkg/util/errors - - pkg/util/framer - - pkg/util/httpstream - - pkg/util/httpstream/spdy - - pkg/util/intstr - - pkg/util/json - - pkg/util/mergepatch - - pkg/util/net - - pkg/util/rand - - pkg/util/runtime - - pkg/util/sets - - pkg/util/strategicpatch - - pkg/util/uuid - - pkg/util/validation - - pkg/util/validation/field - - pkg/util/wait - - pkg/util/yaml - - pkg/version - - pkg/watch - - third_party/forked/golang/json - - third_party/forked/golang/netutil - - third_party/forked/golang/reflect -- name: k8s.io/apiserver - version: fbf5c43dfaa8eb5627bac6058e3bd51db8532cbb - subpackages: - - pkg/authentication/authenticator - - pkg/authentication/serviceaccount - - pkg/authentication/user - - pkg/features - - pkg/server/httplog - - pkg/util/feature - - pkg/util/wsstream -- name: k8s.io/client-go - version: a0a777840a5645f8ad29ff66a999f73ddf975fe3 - subpackages: - - discovery - - dynamic - - kubernetes - - kubernetes/scheme - - kubernetes/typed/apps/v1beta1 - - kubernetes/typed/authentication/v1 - - kubernetes/typed/authentication/v1beta1 - - kubernetes/typed/authorization/v1 - - kubernetes/typed/authorization/v1beta1 - - kubernetes/typed/autoscaling/v1 - - kubernetes/typed/autoscaling/v2alpha1 - - kubernetes/typed/batch/v1 - - kubernetes/typed/batch/v2alpha1 - - kubernetes/typed/certificates/v1beta1 - - kubernetes/typed/core/v1 - - kubernetes/typed/extensions/v1beta1 - - kubernetes/typed/policy/v1beta1 - - kubernetes/typed/rbac/v1alpha1 - - kubernetes/typed/rbac/v1beta1 - - kubernetes/typed/settings/v1alpha1 - - kubernetes/typed/storage/v1 - - kubernetes/typed/storage/v1beta1 - - pkg/api - - pkg/api/install - - pkg/api/v1 - - pkg/apis/apps - - pkg/apis/apps/install - - pkg/apis/apps/v1beta1 - - pkg/apis/authentication - - pkg/apis/authentication/install - - pkg/apis/authentication/v1 - - pkg/apis/authentication/v1beta1 - - pkg/apis/authorization - - pkg/apis/authorization/install - - pkg/apis/authorization/v1 - - pkg/apis/authorization/v1beta1 - - pkg/apis/autoscaling - - pkg/apis/autoscaling/install - - pkg/apis/autoscaling/v1 - - pkg/apis/autoscaling/v2alpha1 - - pkg/apis/batch - - pkg/apis/batch/install - - pkg/apis/batch/v1 - - pkg/apis/batch/v2alpha1 - - pkg/apis/certificates - - pkg/apis/certificates/install - - pkg/apis/certificates/v1beta1 - - pkg/apis/extensions - - pkg/apis/extensions/install - - pkg/apis/extensions/v1beta1 - - pkg/apis/policy - - pkg/apis/policy/install - - pkg/apis/policy/v1beta1 - - pkg/apis/rbac - - pkg/apis/rbac/install - - pkg/apis/rbac/v1alpha1 - - pkg/apis/rbac/v1beta1 - - pkg/apis/settings - - pkg/apis/settings/install - - pkg/apis/settings/v1alpha1 - - pkg/apis/storage - - pkg/apis/storage/install - - pkg/apis/storage/v1 - - pkg/apis/storage/v1beta1 - - pkg/util - - pkg/util/labels - - pkg/util/parsers - - pkg/version - - plugin/pkg/client/auth - - plugin/pkg/client/auth/gcp - - plugin/pkg/client/auth/oidc - - rest - - rest/watch - - third_party/forked/golang/template - - tools/auth - - tools/cache - - tools/clientcmd - - tools/clientcmd/api - - tools/clientcmd/api/latest - - tools/clientcmd/api/v1 - - tools/metrics - - transport - - util/cert - - util/clock - - util/flowcontrol - - util/homedir - - util/integer - - util/jsonpath - - util/workqueue -- name: k8s.io/kubernetes - version: 424a0e9e827a39c714ee03e1891c43635adabcdc - subpackages: - - federation/apis/federation - - federation/apis/federation/install - - federation/apis/federation/v1beta1 - - federation/client/clientset_generated/federation_internalclientset - - federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion - - federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion - - federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion - - federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion - - federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion - - pkg/api - - pkg/api/annotations - - pkg/api/events - - pkg/api/install - - pkg/api/pod - - pkg/api/service - - pkg/api/util - - pkg/api/v1 - - pkg/api/v1/service - - pkg/api/validation - - pkg/api/validation/genericvalidation - - pkg/apis/apps - - pkg/apis/apps/install - - pkg/apis/apps/v1beta1 - - pkg/apis/authentication - - pkg/apis/authentication/install - - pkg/apis/authentication/v1beta1 - - pkg/apis/authorization - - pkg/apis/authorization/install - - pkg/apis/authorization/v1beta1 - - pkg/apis/autoscaling - - pkg/apis/autoscaling/install - - pkg/apis/autoscaling/v1 - - pkg/apis/batch - - pkg/apis/batch/install - - pkg/apis/batch/v1 - - pkg/apis/batch/v2alpha1 - - pkg/apis/certificates - - pkg/apis/certificates/install - - pkg/apis/certificates/v1beta1 - - pkg/apis/componentconfig - - pkg/apis/componentconfig/install - - pkg/apis/componentconfig/v1alpha1 - - pkg/apis/extensions - - pkg/apis/extensions/install - - pkg/apis/extensions/v1beta1 - - pkg/apis/policy - - pkg/apis/policy/install - - pkg/apis/policy/v1beta1 - - pkg/apis/rbac - - pkg/apis/rbac/install - - pkg/apis/rbac/v1alpha1 - - pkg/apis/rbac/v1beta1 - - pkg/apis/storage - - pkg/apis/storage/install - - pkg/apis/storage/util - - pkg/apis/storage/v1beta1 - - pkg/capabilities - - pkg/client/clientset_generated/clientset - - pkg/client/clientset_generated/clientset/typed/apps/v1beta1 - - pkg/client/clientset_generated/clientset/typed/authentication/v1beta1 - - pkg/client/clientset_generated/clientset/typed/authorization/v1beta1 - - pkg/client/clientset_generated/clientset/typed/autoscaling/v1 - - pkg/client/clientset_generated/clientset/typed/batch/v1 - - pkg/client/clientset_generated/clientset/typed/batch/v2alpha1 - - pkg/client/clientset_generated/clientset/typed/certificates/v1beta1 - - pkg/client/clientset_generated/clientset/typed/core/v1 - - pkg/client/clientset_generated/clientset/typed/extensions/v1beta1 - - pkg/client/clientset_generated/clientset/typed/policy/v1beta1 - - pkg/client/clientset_generated/clientset/typed/rbac/v1alpha1 - - pkg/client/clientset_generated/clientset/typed/rbac/v1beta1 - - pkg/client/clientset_generated/clientset/typed/storage/v1beta1 - - pkg/client/clientset_generated/internalclientset - - pkg/client/clientset_generated/internalclientset/typed/apps/internalversion - - pkg/client/clientset_generated/internalclientset/typed/authentication/internalversion - - pkg/client/clientset_generated/internalclientset/typed/authorization/internalversion - - pkg/client/clientset_generated/internalclientset/typed/autoscaling/internalversion - - pkg/client/clientset_generated/internalclientset/typed/batch/internalversion - - pkg/client/clientset_generated/internalclientset/typed/certificates/internalversion - - pkg/client/clientset_generated/internalclientset/typed/core/internalversion - - pkg/client/clientset_generated/internalclientset/typed/extensions/internalversion - - pkg/client/clientset_generated/internalclientset/typed/policy/internalversion - - pkg/client/clientset_generated/internalclientset/typed/rbac/internalversion - - pkg/client/clientset_generated/internalclientset/typed/storage/internalversion - - pkg/client/conditions - - pkg/client/legacylisters - - pkg/client/record - - pkg/client/retry - - pkg/client/unversioned - - pkg/client/unversioned/remotecommand - - pkg/cloudprovider - - pkg/cloudprovider/providers/gce - - pkg/controller - - pkg/controller/deployment/util - - pkg/credentialprovider - - pkg/features - - pkg/fieldpath - - pkg/kubectl - - pkg/kubectl/resource - - pkg/kubelet/api/v1alpha1/runtime - - pkg/kubelet/api/v1alpha1/stats - - pkg/kubelet/cadvisor - - pkg/kubelet/cm - - pkg/kubelet/cm/util - - pkg/kubelet/container - - pkg/kubelet/leaky - - pkg/kubelet/metrics - - pkg/kubelet/network - - pkg/kubelet/qos - - pkg/kubelet/server/remotecommand - - pkg/kubelet/server/stats - - pkg/kubelet/types - - pkg/kubelet/util/format - - pkg/kubelet/util/ioutils - - pkg/master/ports - - pkg/metrics - - pkg/security/apparmor - - pkg/serviceaccount - - pkg/ssh - - pkg/util - - pkg/util/chmod - - pkg/util/chown - - pkg/util/exec - - pkg/util/hash - - pkg/util/interrupt - - pkg/util/io - - pkg/util/labels - - pkg/util/mount - - pkg/util/net/sets - - pkg/util/node - - pkg/util/oom - - pkg/util/parsers - - pkg/util/procfs - - pkg/util/slice - - pkg/util/sysctl - - pkg/util/system - - pkg/util/term - - pkg/util/version - - pkg/volume - - pkg/volume/util - - plugin/pkg/scheduler/algorithm - - plugin/pkg/scheduler/algorithm/predicates - - plugin/pkg/scheduler/algorithm/priorities/util - - plugin/pkg/scheduler/api - - plugin/pkg/scheduler/schedulercache - - test/e2e/framework - - test/e2e/perftype - - test/utils - - third_party/forked/golang/expansion diff --git a/nfs/test/e2e/glide.yaml b/nfs/test/e2e/glide.yaml deleted file mode 100644 index cefe91283e4..00000000000 --- a/nfs/test/e2e/glide.yaml +++ /dev/null @@ -1,166 +0,0 @@ -package: github.com/kubernetes-incubator/external-storage/nfs/test/e2e -import: [] -testImport: -- package: github.com/docker/go-units - version: v0.3.1 -- package: github.com/golang/protobuf - version: c9c7427 - subpackages: - - proto -- package: github.com/onsi/ginkgo -- package: github.com/onsi/gomega -- package: github.com/opencontainers/runc - subpackages: - - libcontainer/selinux -- package: k8s.io/apimachinery - version: d3c1641 - subpackages: - - pkg/api/equality - - pkg/api/errors - - pkg/api/meta - - pkg/api/resource - - pkg/api/validation - - pkg/apimachinery - - pkg/apimachinery/announced - - pkg/apimachinery/registered - - pkg/apis/meta/v1 - - pkg/apis/meta/v1/unstructured - - pkg/apis/meta/v1/validation - - pkg/conversion - - pkg/conversion/queryparams - - pkg/fields - - pkg/labels - - pkg/openapi - - pkg/runtime - - pkg/runtime/schema - - pkg/runtime/serializer - - pkg/runtime/serializer/json - - pkg/runtime/serializer/protobuf - - pkg/runtime/serializer/recognizer - - pkg/runtime/serializer/streaming - - pkg/runtime/serializer/versioning - - pkg/selection - - pkg/types - - pkg/util/diff - - pkg/util/errors - - pkg/util/framer - - pkg/util/httpstream - - pkg/util/httpstream/spdy - - pkg/util/intstr - - pkg/util/json - - pkg/util/mergepatch - - pkg/util/net - - pkg/util/rand - - pkg/util/runtime - - pkg/util/sets - - pkg/util/strategicpatch - - pkg/util/uuid - - pkg/util/validation - - pkg/util/validation/field - - pkg/util/wait - - pkg/util/yaml - - pkg/version - - pkg/watch - - third_party/forked/golang/json - - third_party/forked/golang/netutil - - third_party/forked/golang/reflect -- package: k8s.io/client-go - version: a0a77784 - subpackages: - - discovery - - dynamic - - kubernetes - - kubernetes/scheme - - kubernetes/typed/apps/v1beta1 - - kubernetes/typed/authentication/v1 - - kubernetes/typed/authentication/v1beta1 - - kubernetes/typed/authorization/v1 - - kubernetes/typed/authorization/v1beta1 - - kubernetes/typed/autoscaling/v1 - - kubernetes/typed/autoscaling/v2alpha1 - - kubernetes/typed/batch/v1 - - kubernetes/typed/batch/v2alpha1 - - kubernetes/typed/certificates/v1beta1 - - kubernetes/typed/core/v1 - - kubernetes/typed/extensions/v1beta1 - - kubernetes/typed/policy/v1beta1 - - kubernetes/typed/rbac/v1alpha1 - - kubernetes/typed/rbac/v1beta1 - - kubernetes/typed/settings/v1alpha1 - - kubernetes/typed/storage/v1 - - kubernetes/typed/storage/v1beta1 - - pkg/api - - pkg/api/install - - pkg/api/v1 - - pkg/apis/apps - - pkg/apis/apps/install - - pkg/apis/apps/v1beta1 - - pkg/apis/authentication - - pkg/apis/authentication/install - - pkg/apis/authentication/v1 - - pkg/apis/authentication/v1beta1 - - pkg/apis/authorization - - pkg/apis/authorization/install - - pkg/apis/authorization/v1 - - pkg/apis/authorization/v1beta1 - - pkg/apis/autoscaling - - pkg/apis/autoscaling/install - - pkg/apis/autoscaling/v1 - - pkg/apis/autoscaling/v2alpha1 - - pkg/apis/batch - - pkg/apis/batch/install - - pkg/apis/batch/v1 - - pkg/apis/batch/v2alpha1 - - pkg/apis/certificates - - pkg/apis/certificates/install - - pkg/apis/certificates/v1beta1 - - pkg/apis/extensions - - pkg/apis/extensions/install - - pkg/apis/extensions/v1beta1 - - pkg/apis/policy - - pkg/apis/policy/install - - pkg/apis/policy/v1beta1 - - pkg/apis/rbac - - pkg/apis/rbac/install - - pkg/apis/rbac/v1alpha1 - - pkg/apis/rbac/v1beta1 - - pkg/apis/settings - - pkg/apis/settings/install - - pkg/apis/settings/v1alpha1 - - pkg/apis/storage - - pkg/apis/storage/install - - pkg/apis/storage/v1 - - pkg/apis/storage/v1beta1 - - pkg/util - - pkg/util/parsers - - pkg/version - - plugin/pkg/client/auth - - plugin/pkg/client/auth/gcp - - plugin/pkg/client/auth/oidc - - rest - - rest/watch - - third_party/forked/golang/template - - tools/auth - - tools/cache - - tools/clientcmd - - tools/clientcmd/api - - tools/clientcmd/api/latest - - tools/clientcmd/api/v1 - - tools/metrics - - transport - - util/cert - - util/clock - - util/flowcontrol - - util/homedir - - util/integer - - util/jsonpath - - util/workqueue -- package: k8s.io/kubernetes - version: v1.6.0-alpha.1 - subpackages: - - pkg/api - - pkg/api/v1 - - pkg/apis/extensions/v1beta1 - - pkg/apis/storage/v1beta1 - - pkg/client/clientset_generated/clientset - - test/e2e/framework diff --git a/nfs/test/e2e/nfs.go b/nfs/test/e2e/nfs.go new file mode 100644 index 00000000000..60924e1c995 --- /dev/null +++ b/nfs/test/e2e/nfs.go @@ -0,0 +1,166 @@ +/* +Copyright 2018 The Kubernetes 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 storage + +import ( + "fmt" + "path/filepath" + "time" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + + "io/ioutil" + "k8s.io/api/core/v1" + apierrs "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clientset "k8s.io/client-go/kubernetes" + "k8s.io/kubernetes/test/e2e/framework" +) + +const ( + manifestPath = "test/e2e/testing-manifests/" + nfsStatefulSetName = "nfs-provisioner" + + nfsRBACCRName = "nfs-provisioner-runner" + nfsRBACCRBName = "run-nfs-provisioner" + + nfsClaimName = "nfs" + nfsClaimSize = "1Mi" + + nfsClassName = "example-nfs" + + nfsWritePodName = "write-pod" + + nfsReadPodName = "read-pod" +) + +var _ = Describe("external-storage", func() { + f := framework.NewDefaultFramework("external-storage") + + // filled in BeforeEach + var c clientset.Interface + var ns string + + BeforeEach(func() { + c = f.ClientSet + ns = f.Namespace.Name + }) + + AfterEach(func() { + c.RbacV1().ClusterRoles().Delete(nfsRBACCRName, nil) + c.RbacV1().ClusterRoleBindings().Delete(nfsRBACCRBName, nil) + c.StorageV1().StorageClasses().Delete(nfsClassName, nil) + }) + + Describe("NFS external provisioner", func() { + mkpath := func(file string) string { + return filepath.Join(framework.TestContext.RepoRoot, manifestPath, file) + } + + It("should create and delete persistent volumes when deployed with yamls", func() { + nsFlag := fmt.Sprintf("--namespace=%v", ns) + + By("creating nfs-provisioner RBAC") + framework.RunKubectlOrDie("create", "-f", mkpath("rbac.yaml")) + crb, err := c.RbacV1().ClusterRoleBindings().Get(nfsRBACCRBName, metav1.GetOptions{}) + Expect(err).NotTo(HaveOccurred()) + + crb.Subjects[0].Namespace = ns + crb, err = c.RbacV1().ClusterRoleBindings().Update(crb) + Expect(err).NotTo(HaveOccurred()) + + By("creating an nfs-provisioner statefulset") + framework.RunKubectlOrDie("create", "-f", mkpath("statefulset.yaml"), nsFlag) + tmpDir, err := ioutil.TempDir("", "nfs-provisioner-statefulset") + Expect(err).NotTo(HaveOccurred()) + + ss, err := c.AppsV1().StatefulSets(ns).Get(nfsStatefulSetName, metav1.GetOptions{}) + Expect(err).NotTo(HaveOccurred()) + ss.Spec.Template.Spec.Volumes[0].HostPath.Path = tmpDir + ss.Spec.Template.Spec.Containers[0].Args = []string{"-grace-period=10"} + ss, err = c.AppsV1().StatefulSets(ns).Update(ss) + Expect(err).NotTo(HaveOccurred()) + + sst := framework.NewStatefulSetTester(c) + sst.WaitForRunningAndReady(*ss.Spec.Replicas, ss) + + By("creating a class") + framework.RunKubectlOrDie("create", "-f", mkpath("class.yaml")) + + By("checking the class") + class, err := c.StorageV1beta1().StorageClasses().Get(nfsClassName, metav1.GetOptions{}) + Expect(err).NotTo(HaveOccurred()) + + By("creating a claim") + framework.RunKubectlOrDie("create", "-f", mkpath("claim.yaml"), nsFlag) + err = framework.WaitForPersistentVolumeClaimPhase(v1.ClaimBound, c, ns, nfsClaimName, framework.Poll, 60*time.Second) + Expect(err).NotTo(HaveOccurred()) + + By("checking the claim") + // Get new copy of the claim + claim, err := c.CoreV1().PersistentVolumeClaims(ns).Get(nfsClaimName, metav1.GetOptions{}) + Expect(err).NotTo(HaveOccurred()) + + By("checking the volume") + // Get the bound PV + pv, err := c.CoreV1().PersistentVolumes().Get(claim.Spec.VolumeName, metav1.GetOptions{}) + Expect(err).NotTo(HaveOccurred()) + + // Check sizes + expectedCapacity := resource.MustParse(nfsClaimSize) + pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)] + Expect(pvCapacity.Value()).To(Equal(expectedCapacity.Value()), "pvCapacity is not equal to expectedCapacity") + + // Check PV properties + expectedAccessModes := []v1.PersistentVolumeAccessMode{v1.ReadWriteMany} + Expect(pv.Spec.AccessModes).To(Equal(expectedAccessModes)) + Expect(pv.Spec.ClaimRef.Name).To(Equal(claim.ObjectMeta.Name)) + Expect(pv.Spec.ClaimRef.Namespace).To(Equal(claim.ObjectMeta.Namespace)) + Expect(pv.Spec.PersistentVolumeReclaimPolicy).To(Equal(*class.ReclaimPolicy)) + Expect(pv.Spec.MountOptions).To(Equal(class.MountOptions)) + + By("creating a pod to write to the volume") + framework.RunKubectlOrDie("create", "-f", mkpath("write-pod.yaml"), nsFlag) + framework.ExpectNoError(framework.WaitForPodSuccessInNamespace(c, nfsWritePodName, ns)) + + By("creating a pod to read from the volume") + framework.RunKubectlOrDie("create", "-f", mkpath("read-pod.yaml"), nsFlag) + framework.ExpectNoError(framework.WaitForPodSuccessInNamespace(c, nfsReadPodName, ns)) + framework.DeletePodOrFail(c, ns, nfsReadPodName) + + By("scaling the nfs-provisioner statefulset down and up") + sst.Restart(ss) + + By("creating a pod to read from the volume again") + framework.RunKubectlOrDie("create", "-f", mkpath("read-pod.yaml"), nsFlag) + framework.ExpectNoError(framework.WaitForPodSuccessInNamespace(c, nfsReadPodName, ns)) + + By("deleting the claim") + err = c.CoreV1().PersistentVolumeClaims(ns).Delete(nfsClaimName, nil) + if err != nil && !apierrs.IsNotFound(err) { + framework.Failf("Error deleting claim %q. Error: %v", claim.Name, err) + } + + By("waiting for the volume to be deleted") + if pv.Spec.PersistentVolumeReclaimPolicy == v1.PersistentVolumeReclaimDelete { + framework.ExpectNoError(framework.WaitForPersistentVolumeDeleted(c, pv.Name, 5*time.Second, 60*time.Second)) + } + }) + }) +}) diff --git a/nfs/test/e2e/test.sh b/nfs/test/e2e/test.sh new file mode 100755 index 00000000000..a4c1809c99d --- /dev/null +++ b/nfs/test/e2e/test.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# Copyright 2018 The Kubernetes 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. + +# Vendoring the e2e framework is too hard. Download kubernetes source, patch +# our tests on top of it, build and run from there. + +KUBE_VERSION=1.11.0 +TEST_DIR=$GOPATH/src/github.com/kubernetes-incubator/external-storage/nfs/test/e2e + +GOPATH=$TEST_DIR + +# Download kubernetes source +if [ ! -e "$GOPATH/src/k8s.io/kubernetes" ]; then + mkdir -p $GOPATH/src/k8s.io + curl -L https://github.com/kubernetes/kubernetes/archive/v${KUBE_VERSION}.tar.gz | tar xz -C $TEST_DIR/src/k8s.io/ + rm -rf $GOPATH/src/k8s.io/kubernetes + mv $GOPATH/src/k8s.io/kubernetes-$KUBE_VERSION $GOPATH/src/k8s.io/kubernetes +fi + +cd $GOPATH/src/k8s.io/kubernetes + +# Clean some unneeded sources +find ./test/e2e -maxdepth 1 -type d ! -name 'e2e' ! -name 'framework' ! -name 'manifest' ! -name 'common' ! -name 'generated' ! -name 'testing-manifests' ! -name 'perftype' -exec rm -r {} + +find ./test/e2e -maxdepth 1 -type f \( -name 'examples.go' -o -name 'gke_local_ssd.go' -o -name 'gke_node_pools.go' \) -delete +find ./test/e2e/testing-manifests -maxdepth 1 ! -name 'testing-manifests' ! -name 'BUILD' -exec rm -r {} + + +# Copy our sources +mkdir ./test/e2e/storage +ln -s $TEST_DIR/nfs.go ./test/e2e/storage/ +rm ./test/e2e/e2e_test.go +ln -s $TEST_DIR/e2e_test.go ./test/e2e/ +cp -r $TEST_DIR/testing-manifests/* ./test/e2e/testing-manifests + +# Build ginkgo and e2e.test +hack/update-bazel.sh +make clean +make ginkgo +if ! type bazel; then + wget https://github.com/bazelbuild/bazel/releases/download/0.16.0/bazel-0.16.0-installer-linux-x86_64.sh + chmod +x bazel-0.16.0-installer-linux-x86_64.sh + ./bazel-0.16.0-installer-linux-x86_64.sh --user +fi +bazel build //test/e2e:gen_e2e.test +rm -f ./_output/bin/e2e.test +cp ./bazel-bin/test/e2e/e2e.test ./_output/bin + +# Download kubectl to _output directory +curl -o ./_output/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl +chmod +x ./_output/bin/kubectl + +# Run tests assuming local cluster i.e. one started with hack/local-up-cluster.sh +go run hack/e2e.go -- --provider=local --check-version-skew=false --test --test_args="--ginkgo.focus=external-storage" diff --git a/nfs/test/e2e/testing-manifests b/nfs/test/e2e/testing-manifests new file mode 120000 index 00000000000..482cec98e6c --- /dev/null +++ b/nfs/test/e2e/testing-manifests @@ -0,0 +1 @@ +../../deploy/kubernetes \ No newline at end of file diff --git a/test.sh b/test.sh index 0ff0e695655..44dfd393f85 100755 --- a/test.sh +++ b/test.sh @@ -44,8 +44,7 @@ if [ "$TRAVIS_OS_NAME" != "osx" ]; then fi fi -# Install glide, golint, cfssl -curl https://glide.sh/get | sh +# Install golint, cfssl go get -u github.com/golang/lint/golint export PATH=$PATH:$GOPATH/bin go get -u github.com/alecthomas/gometalinter @@ -85,7 +84,11 @@ elif [ "$TEST_SUITE" = "linux-nfs" ]; then # Start kubernetes mkdir -p $HOME/.kube sudo chmod -R 777 $HOME/.kube - sudo "PATH=$PATH" KUBECTL=$HOME/kubernetes/server/bin/kubectl ALLOW_SECURITY_CONTEXT=true API_HOST_IP=0.0.0.0 $HOME/kubernetes-${KUBE_VERSION}/hack/local-up-cluster.sh -o $HOME/kubernetes/server/bin >/tmp/local-up-cluster.log 2>&1 & + if [ "$KUBE_VERSION" = "1.5.8" ]; then + sudo "PATH=$PATH" KUBECTL=$HOME/kubernetes/server/bin/kubectl ENABLE_RBAC=true ALLOW_SECURITY_CONTEXT=true API_HOST_IP=0.0.0.0 $HOME/kubernetes-${KUBE_VERSION}/hack/local-up-cluster.sh -o $HOME/kubernetes/server/bin >/tmp/local-up-cluster.log 2>&1 & + else + sudo "PATH=$PATH" KUBECTL=$HOME/kubernetes/server/bin/kubectl ALLOW_SECURITY_CONTEXT=true $HOME/kubernetes-${KUBE_VERSION}/hack/local-up-cluster.sh -o $HOME/kubernetes/server/bin >/tmp/local-up-cluster.log 2>&1 & + fi touch /tmp/local-up-cluster.log timeout 30 grep -q "Local Kubernetes cluster is running." <(tail -f /tmp/local-up-cluster.log) if [ $? == 124 ]; then @@ -93,7 +96,7 @@ elif [ "$TEST_SUITE" = "linux-nfs" ]; then exit 1 fi KUBECTL=$HOME/kubernetes/server/bin/kubectl - if [ "$KUBE_VERSION" = "1.5.4" ]; then + if [ "$KUBE_VERSION" = "1.5.8" ]; then $KUBECTL config set-cluster local --server=https://localhost:6443 --certificate-authority=/var/run/kubernetes/apiserver.crt; $KUBECTL config set-credentials myself --username=admin --password=admin; else @@ -102,7 +105,7 @@ elif [ "$TEST_SUITE" = "linux-nfs" ]; then fi $KUBECTL config set-context local --cluster=local --user=myself $KUBECTL config use-context local - if [ "$KUBE_VERSION" != "1.5.4" ]; then + if [ "$KUBE_VERSION" != "1.5.8" ]; then sudo chown -R $(logname) /var/run/kubernetes; fi