From bcd33bae2a1eafc6e6a1b544dbe303ce843746e5 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Fri, 16 Apr 2021 11:51:38 -0700 Subject: [PATCH 01/11] Added Test cases for EnvVars check on CNI daemonset --- test/framework/options.go | 5 +- .../resources/k8s/manifest/deployment.go | 7 + .../resources/k8s/resources/deployment.go | 22 +++ .../framework/resources/k8s/resources/node.go | 8 ++ .../cni/env_vars/env_suite_test.go | 76 ++++++++++ test/integration-new/cni/env_vars/env_test.go | 136 ++++++++++++++++++ 6 files changed, 252 insertions(+), 2 deletions(-) create mode 100644 test/integration-new/cni/env_vars/env_suite_test.go create mode 100644 test/integration-new/cni/env_vars/env_test.go diff --git a/test/framework/options.go b/test/framework/options.go index 065c19f20d..a8eeea3d2c 100644 --- a/test/framework/options.go +++ b/test/framework/options.go @@ -33,6 +33,7 @@ type Options struct { AWSVPCID string NgNameLabelKey string NgNameLabelVal string + IgnoreOptional bool } func (options *Options) BindFlags() { @@ -57,10 +58,10 @@ func (options *Options) Validate() error { if len(options.AWSVPCID) == 0 { return errors.Errorf("%s must be set!", "aws-vpc-id") } - if len(options.NgNameLabelKey) == 0 { + if !options.IgnoreOptional && len(options.NgNameLabelKey) == 0 { return errors.Errorf("%s must be set!", "ng-name-label-key") } - if len(options.NgNameLabelVal) == 0 { + if !options.IgnoreOptional && len(options.NgNameLabelVal) == 0 { return errors.Errorf("%s must be set!", "ng-name-label-val") } diff --git a/test/framework/resources/k8s/manifest/deployment.go b/test/framework/resources/k8s/manifest/deployment.go index a835f5f0dd..04f08197a6 100644 --- a/test/framework/resources/k8s/manifest/deployment.go +++ b/test/framework/resources/k8s/manifest/deployment.go @@ -30,6 +30,7 @@ type DeploymentBuilder struct { labels map[string]string terminationGracePeriod int nodeName string + hostNetwork bool } func NewBusyBoxDeploymentBuilder() *DeploymentBuilder { @@ -86,6 +87,11 @@ func (d *DeploymentBuilder) PodLabel(labelKey string, labelValue string) *Deploy return d } +func (d *DeploymentBuilder) HostNetwork(hostNetwork bool) *DeploymentBuilder { + d.hostNetwork = hostNetwork + return d +} + func (d *DeploymentBuilder) Build() *v1.Deployment { return &v1.Deployment{ ObjectMeta: metav1.ObjectMeta{ @@ -103,6 +109,7 @@ func (d *DeploymentBuilder) Build() *v1.Deployment { Labels: d.labels, }, Spec: corev1.PodSpec{ + HostNetwork: d.hostNetwork, Containers: []corev1.Container{d.container}, TerminationGracePeriodSeconds: aws.Int64(int64(d.terminationGracePeriod)), NodeName: d.nodeName, diff --git a/test/framework/resources/k8s/resources/deployment.go b/test/framework/resources/k8s/resources/deployment.go index 2f8d33867c..69adc20efb 100644 --- a/test/framework/resources/k8s/resources/deployment.go +++ b/test/framework/resources/k8s/resources/deployment.go @@ -20,6 +20,7 @@ import ( "github.com/aws/amazon-vpc-cni-k8s/test/framework/utils" v1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" @@ -28,6 +29,7 @@ import ( type DeploymentManager interface { CreateAndWaitTillDeploymentIsReady(deployment *v1.Deployment) (*v1.Deployment, error) DeleteAndWaitTillDeploymentIsDeleted(deployment *v1.Deployment) error + MountVolume(deployment *v1.Deployment, name string, mountpath string) } type defaultDeploymentManager struct { @@ -77,6 +79,26 @@ func (d defaultDeploymentManager) DeleteAndWaitTillDeploymentIsDeleted(deploymen }, ctx.Done()) } +func (d defaultDeploymentManager) MountVolume(deployment *v1.Deployment, name string, mountpath string) { + deployment.Spec.Template.Spec.Volumes = []corev1.Volume{ + { + Name: name, + VolumeSource: corev1.VolumeSource{ + HostPath: &corev1.HostPathVolumeSource{ + Path: mountpath, + }, + }, + }, + } + + deployment.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{ + { + Name: name, + MountPath: name, + }, + } +} + func NewDefaultDeploymentManager(k8sClient client.DelegatingClient) DeploymentManager { return &defaultDeploymentManager{k8sClient: k8sClient} } diff --git a/test/framework/resources/k8s/resources/node.go b/test/framework/resources/k8s/resources/node.go index d72eeac18b..78ca85e969 100644 --- a/test/framework/resources/k8s/resources/node.go +++ b/test/framework/resources/k8s/resources/node.go @@ -22,6 +22,7 @@ import ( type NodeManager interface { GetNodes(nodeLabelKey string, nodeLabelVal string) (v1.NodeList, error) + GetAllNodes() (v1.NodeList, error) } type defaultNodeManager struct { @@ -40,3 +41,10 @@ func (d *defaultNodeManager) GetNodes(nodeLabelKey string, nodeLabelVal string) }) return nodeList, err } + +func (d *defaultNodeManager) GetAllNodes() (v1.NodeList, error) { + ctx := context.Background() + nodeList := v1.NodeList{} + err := d.k8sClient.List(ctx, &nodeList) + return nodeList, err +} diff --git a/test/integration-new/cni/env_vars/env_suite_test.go b/test/integration-new/cni/env_vars/env_suite_test.go new file mode 100644 index 0000000000..0036b99734 --- /dev/null +++ b/test/integration-new/cni/env_vars/env_suite_test.go @@ -0,0 +1,76 @@ +package env_vars + +import ( + "testing" + + "github.com/aws/amazon-vpc-cni-k8s/test/framework" + "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + appsV1 "k8s.io/api/apps/v1" + v1 "k8s.io/api/core/v1" +) + +const ( + NAMESPACE = "kube-system" + DAEMONSET = "aws-node" + HOST_POD_LABEL_KEY = "network" + HOST_POD_LABEL_VAL = "host" +) + +var ( + primaryNode v1.Node + primaryInstanceId string + ds *appsV1.DaemonSet + f *framework.Framework + hostNetworkDeploymentSpec *appsV1.Deployment + hostNetworkDeployment *appsV1.Deployment + err error + hostNetworkPod v1.Pod +) + +func TestCni(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Cni Suite") +} + +var _ = BeforeSuite(func() { + globalOptions := framework.GlobalOptions + globalOptions.IgnoreOptional = true + f = framework.New(globalOptions) + ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) + Expect(err).NotTo(HaveOccurred()) + + nodes, err := f.K8sResourceManagers.NodeManager().GetAllNodes() + Expect(err).NotTo(HaveOccurred()) + Expect(len(nodes.Items)).To(BeNumerically(">", 0)) + + primaryNode = nodes.Items[0] + primaryInstanceId = k8sUtils.GetInstanceIDFromNode(primaryNode) + + hostNetworkDeploymentSpec = manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("host-network"). + Replicas(1). + HostNetwork(true). + PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). + NodeName(primaryNode.Name). + Build() + + f.K8sResourceManagers.DeploymentManager().MountVolume(hostNetworkDeploymentSpec, "ipamd-logs", "/var/log/aws-routed-eni/") + hostNetworkDeployment, err = f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) + Expect(err).NotTo(HaveOccurred()) + + pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL) + Expect(err).NotTo(HaveOccurred()) + + hostNetworkPod = pods.Items[0] +}) + +var _ = AfterSuite(func() { + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) + Expect(err).NotTo(HaveOccurred()) +}) diff --git a/test/integration-new/cni/env_vars/env_test.go b/test/integration-new/cni/env_vars/env_test.go new file mode 100644 index 0000000000..b203507d6f --- /dev/null +++ b/test/integration-new/cni/env_vars/env_test.go @@ -0,0 +1,136 @@ +package env_vars + +import ( + "regexp" + + "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +const ( + AWS_VPC_ENI_MTU = "AWS_VPC_ENI_MTU" + AWS_VPC_K8S_CNI_LOG_FILE = "AWS_VPC_K8S_CNI_LOG_FILE" + AWS_VPC_K8S_CNI_VETHPREFIX = "AWS_VPC_K8S_CNI_VETHPREFIX" +) + +var _ = Describe("cni env test", func() { + + Context("CNI Environment Variables", func() { + It("Verifying that secondary ENI is created", func() { + nodes, err := f.K8sResourceManagers.NodeManager().GetAllNodes() + Expect(err).NotTo(HaveOccurred()) + + for _, node := range nodes.Items { + instanceId := k8sUtils.GetInstanceIDFromNode(node) + instance, err := f.CloudServices.EC2().DescribeInstance(instanceId) + Expect(err).NotTo(HaveOccurred()) + + len := len(instance.NetworkInterfaces) + Expect(len).To(Equal(2)) + } + }) + + FIt("Changing AWS_VPC_ENI_MTU and AWS_VPC_K8S_CNI_VETHPREFIX", func() { + currMTUVal := getEnvValueForKey(AWS_VPC_ENI_MTU) + Expect(currMTUVal).NotTo(Equal("")) + + currVETHPrefix := getEnvValueForKey(AWS_VPC_K8S_CNI_VETHPREFIX) + Expect(currVETHPrefix).NotTo(Equal("")) + + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, map[string]string{ + AWS_VPC_ENI_MTU: "1300", + AWS_VPC_K8S_CNI_VETHPREFIX: "veth", + }) + + By("Deploying a BusyBox deployment", func() { + deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("busybox"). + Replicas(1). + NodeName(primaryNode.Name).Build() + + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpec) + + Expect(err).ToNot(HaveOccurred()) + + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) + Expect(err).NotTo(HaveOccurred()) + + re := regexp.MustCompile(`\n`) + input := re.ReplaceAllString(stdout, "") + + re = regexp.MustCompile(`eth.*lo`) + eth := re.FindStringSubmatch(input)[0] + + re = regexp.MustCompile(`MTU:[0-9]*`) + mtus := re.FindAllStringSubmatch(eth, -1) + + By("Validating new MTU value", func() { + // Validate MTU + for _, m := range mtus { + Expect(m[0]).To(Equal("MTU:1300")) + } + }) + + By("Validating new VETH Prefix", func() { + // Validate VETH Prefix + // Adding the new MTU value to below regex ensures that we are checking the recently created + // veth and not any older entries + re = regexp.MustCompile(`veth.*MTU:1300`) + veth := re.FindAllString(input, -1) + + Expect(len(veth)).NotTo(Equal(0)) + }) + + By("Deleting BusyBox Deployment", func() { + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) + Expect(err).NotTo(HaveOccurred()) + }) + }) + restoreOldValues(map[string]string{ + AWS_VPC_ENI_MTU: currMTUVal, + AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, + }) + }) + + It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { + currLogFilepath := getEnvValueForKey(AWS_VPC_K8S_CNI_LOG_FILE) + Expect(currLogFilepath).NotTo(Equal("")) + + newLogFile := "ipamd_test.log" + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, map[string]string{ + AWS_VPC_K8S_CNI_LOG_FILE: "/host/var/log/aws-routed-eni/" + newLogFile, + }) + + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"tail", "-n", "5", "ipamd-logs/ipamd_test.log"}) + Expect(err).NotTo(HaveOccurred()) + + Expect(stdout).NotTo(Equal("")) + + restoreOldValues(map[string]string{ + AWS_VPC_K8S_CNI_LOG_FILE: currLogFilepath, + }) + }) + }) +}) + +func getEnvValueForKey(key string) string { + envVar := ds.Spec.Template.Spec.Containers[0].Env + for _, env := range envVar { + if env.Name == key { + return env.Value + } + } + return "" +} + +func restoreOldValues(oldVals map[string]string) { + By("Restoring old value on daemonset", func() { + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, oldVals) + }) +} From 8b13e6a3c2458aeb14b5e104fa213a5f87726d13 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Fri, 16 Apr 2021 12:00:22 -0700 Subject: [PATCH 02/11] Minor change --- test/integration-new/cni/env_vars/env_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration-new/cni/env_vars/env_test.go b/test/integration-new/cni/env_vars/env_test.go index b203507d6f..ee3bd4408f 100644 --- a/test/integration-new/cni/env_vars/env_test.go +++ b/test/integration-new/cni/env_vars/env_test.go @@ -33,7 +33,7 @@ var _ = Describe("cni env test", func() { } }) - FIt("Changing AWS_VPC_ENI_MTU and AWS_VPC_K8S_CNI_VETHPREFIX", func() { + It("Changing AWS_VPC_ENI_MTU and AWS_VPC_K8S_CNI_VETHPREFIX", func() { currMTUVal := getEnvValueForKey(AWS_VPC_ENI_MTU) Expect(currMTUVal).NotTo(Equal("")) From 22213150eb4101c566bf6bca7651949ef3f44524 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Thu, 22 Apr 2021 12:35:50 -0700 Subject: [PATCH 03/11] Addressed PR comments --- .../resources/k8s/manifest/deployment.go | 31 +++++++++++- .../resources/k8s/resources/deployment.go | 22 --------- .../cni/env_vars/env_suite_test.go | 3 +- test/integration-new/cni/env_vars/env_test.go | 47 +++++++++++-------- 4 files changed, 60 insertions(+), 43 deletions(-) diff --git a/test/framework/resources/k8s/manifest/deployment.go b/test/framework/resources/k8s/manifest/deployment.go index 04f08197a6..fc55f0f246 100644 --- a/test/framework/resources/k8s/manifest/deployment.go +++ b/test/framework/resources/k8s/manifest/deployment.go @@ -31,6 +31,8 @@ type DeploymentBuilder struct { terminationGracePeriod int nodeName string hostNetwork bool + volume []corev1.Volume + volumeMount []corev1.VolumeMount } func NewBusyBoxDeploymentBuilder() *DeploymentBuilder { @@ -92,8 +94,29 @@ func (d *DeploymentBuilder) HostNetwork(hostNetwork bool) *DeploymentBuilder { return d } +func (d *DeploymentBuilder) MountVolume(name string, mountpath string) *DeploymentBuilder { + d.volume = []corev1.Volume{ + { + Name: name, + VolumeSource: corev1.VolumeSource{ + HostPath: &corev1.HostPathVolumeSource{ + Path: mountpath, + }, + }, + }, + } + + d.volumeMount = []corev1.VolumeMount{ + { + Name: name, + MountPath: name, + }, + } + return d +} + func (d *DeploymentBuilder) Build() *v1.Deployment { - return &v1.Deployment{ + deploymentSpec := &v1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: d.name, Namespace: d.namespace, @@ -117,4 +140,10 @@ func (d *DeploymentBuilder) Build() *v1.Deployment { }, }, } + + if len(d.volume) > 0 && len(d.volumeMount) > 0 { + deploymentSpec.Spec.Template.Spec.Volumes = d.volume + deploymentSpec.Spec.Template.Spec.Containers[0].VolumeMounts = d.volumeMount + } + return deploymentSpec } diff --git a/test/framework/resources/k8s/resources/deployment.go b/test/framework/resources/k8s/resources/deployment.go index 69adc20efb..2f8d33867c 100644 --- a/test/framework/resources/k8s/resources/deployment.go +++ b/test/framework/resources/k8s/resources/deployment.go @@ -20,7 +20,6 @@ import ( "github.com/aws/amazon-vpc-cni-k8s/test/framework/utils" v1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" @@ -29,7 +28,6 @@ import ( type DeploymentManager interface { CreateAndWaitTillDeploymentIsReady(deployment *v1.Deployment) (*v1.Deployment, error) DeleteAndWaitTillDeploymentIsDeleted(deployment *v1.Deployment) error - MountVolume(deployment *v1.Deployment, name string, mountpath string) } type defaultDeploymentManager struct { @@ -79,26 +77,6 @@ func (d defaultDeploymentManager) DeleteAndWaitTillDeploymentIsDeleted(deploymen }, ctx.Done()) } -func (d defaultDeploymentManager) MountVolume(deployment *v1.Deployment, name string, mountpath string) { - deployment.Spec.Template.Spec.Volumes = []corev1.Volume{ - { - Name: name, - VolumeSource: corev1.VolumeSource{ - HostPath: &corev1.HostPathVolumeSource{ - Path: mountpath, - }, - }, - }, - } - - deployment.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{ - { - Name: name, - MountPath: name, - }, - } -} - func NewDefaultDeploymentManager(k8sClient client.DelegatingClient) DeploymentManager { return &defaultDeploymentManager{k8sClient: k8sClient} } diff --git a/test/integration-new/cni/env_vars/env_suite_test.go b/test/integration-new/cni/env_vars/env_suite_test.go index 0036b99734..013dcdd752 100644 --- a/test/integration-new/cni/env_vars/env_suite_test.go +++ b/test/integration-new/cni/env_vars/env_suite_test.go @@ -56,9 +56,10 @@ var _ = BeforeSuite(func() { HostNetwork(true). PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). NodeName(primaryNode.Name). + MountVolume("ipamd-logs", "/var/log/aws-routed-eni/"). Build() - f.K8sResourceManagers.DeploymentManager().MountVolume(hostNetworkDeploymentSpec, "ipamd-logs", "/var/log/aws-routed-eni/") + //f.K8sResourceManagers.DeploymentManager().MountVolume(hostNetworkDeploymentSpec, "ipamd-logs", "/var/log/aws-routed-eni/") hostNetworkDeployment, err = f.K8sResourceManagers. DeploymentManager(). CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) diff --git a/test/integration-new/cni/env_vars/env_test.go b/test/integration-new/cni/env_vars/env_test.go index ee3bd4408f..26c4776d60 100644 --- a/test/integration-new/cni/env_vars/env_test.go +++ b/test/integration-new/cni/env_vars/env_test.go @@ -29,7 +29,7 @@ var _ = Describe("cni env test", func() { Expect(err).NotTo(HaveOccurred()) len := len(instance.NetworkInterfaces) - Expect(len).To(Equal(2)) + Expect(len).To(BeNumerically(">=", 2)) } }) @@ -45,12 +45,14 @@ var _ = Describe("cni env test", func() { AWS_VPC_K8S_CNI_VETHPREFIX: "veth", }) - By("Deploying a BusyBox deployment", func() { + By("Deploying a BusyBox deployment") + { deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). Namespace("default"). Name("busybox"). Replicas(1). - NodeName(primaryNode.Name).Build() + NodeName(primaryNode.Name). + Build() _, err := f.K8sResourceManagers. DeploymentManager(). @@ -70,14 +72,16 @@ var _ = Describe("cni env test", func() { re = regexp.MustCompile(`MTU:[0-9]*`) mtus := re.FindAllStringSubmatch(eth, -1) - By("Validating new MTU value", func() { + By("Validating new MTU value") + { // Validate MTU for _, m := range mtus { Expect(m[0]).To(Equal("MTU:1300")) } - }) + } - By("Validating new VETH Prefix", func() { + By("Validating new VETH Prefix") + { // Validate VETH Prefix // Adding the new MTU value to below regex ensures that we are checking the recently created // veth and not any older entries @@ -85,17 +89,21 @@ var _ = Describe("cni env test", func() { veth := re.FindAllString(input, -1) Expect(len(veth)).NotTo(Equal(0)) - }) + } - By("Deleting BusyBox Deployment", func() { + By("Deleting BusyBox Deployment") + { err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) Expect(err).NotTo(HaveOccurred()) + } + } + By("Restoring old value on daemonset") + { + restoreOldValues(map[string]string{ + AWS_VPC_ENI_MTU: currMTUVal, + AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, }) - }) - restoreOldValues(map[string]string{ - AWS_VPC_ENI_MTU: currMTUVal, - AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, - }) + } }) It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { @@ -112,9 +120,12 @@ var _ = Describe("cni env test", func() { Expect(stdout).NotTo(Equal("")) - restoreOldValues(map[string]string{ - AWS_VPC_K8S_CNI_LOG_FILE: currLogFilepath, - }) + By("Restoring old value on daemonset") + { + restoreOldValues(map[string]string{ + AWS_VPC_K8S_CNI_LOG_FILE: currLogFilepath, + }) + } }) }) }) @@ -130,7 +141,5 @@ func getEnvValueForKey(key string) string { } func restoreOldValues(oldVals map[string]string) { - By("Restoring old value on daemonset", func() { - k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, oldVals) - }) + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, oldVals) } From 1c14075ac999cf5d77004a26da5b3d442df65819 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Thu, 22 Apr 2021 17:46:47 -0700 Subject: [PATCH 04/11] Added Test to check IP allocations/deallocations on the instance --- .../resources/k8s/manifest/container.go | 6 +- .../resources/k8s/manifest/deployment.go | 2 +- .../config_suite_test.go} | 0 .../cni/{env_vars => eni_config}/env_test.go | 0 .../cni/eni_config/ipleak_test.go | 91 +++++++++++++++++++ 5 files changed, 95 insertions(+), 4 deletions(-) rename test/integration-new/cni/{env_vars/env_suite_test.go => eni_config/config_suite_test.go} (100%) rename test/integration-new/cni/{env_vars => eni_config}/env_test.go (100%) create mode 100644 test/integration-new/cni/eni_config/ipleak_test.go diff --git a/test/framework/resources/k8s/manifest/container.go b/test/framework/resources/k8s/manifest/container.go index 2cba02f529..9ee076455d 100644 --- a/test/framework/resources/k8s/manifest/container.go +++ b/test/framework/resources/k8s/manifest/container.go @@ -25,10 +25,10 @@ type Container struct { args []string } -func NewBusyBoxContainerBuilder() *Container { +func NewContainerWithCurlerBuilder() *Container { return &Container{ - name: "busybox", - image: "busybox", + name: "curler", + image: "curlimages/curl:7.76.1", imagePullPolicy: v1.PullIfNotPresent, command: []string{"sleep", "3600"}, args: []string{}, diff --git a/test/framework/resources/k8s/manifest/deployment.go b/test/framework/resources/k8s/manifest/deployment.go index fc55f0f246..ffb6ba5547 100644 --- a/test/framework/resources/k8s/manifest/deployment.go +++ b/test/framework/resources/k8s/manifest/deployment.go @@ -40,7 +40,7 @@ func NewBusyBoxDeploymentBuilder() *DeploymentBuilder { namespace: utils.DefaultTestNamespace, name: "deployment-test", replicas: 10, - container: NewBusyBoxContainerBuilder().Build(), + container: NewContainerWithCurlerBuilder().Build(), labels: map[string]string{"role": "test"}, terminationGracePeriod: 0, } diff --git a/test/integration-new/cni/env_vars/env_suite_test.go b/test/integration-new/cni/eni_config/config_suite_test.go similarity index 100% rename from test/integration-new/cni/env_vars/env_suite_test.go rename to test/integration-new/cni/eni_config/config_suite_test.go diff --git a/test/integration-new/cni/env_vars/env_test.go b/test/integration-new/cni/eni_config/env_test.go similarity index 100% rename from test/integration-new/cni/env_vars/env_test.go rename to test/integration-new/cni/eni_config/env_test.go diff --git a/test/integration-new/cni/eni_config/ipleak_test.go b/test/integration-new/cni/eni_config/ipleak_test.go new file mode 100644 index 0000000000..38428c8a14 --- /dev/null +++ b/test/integration-new/cni/eni_config/ipleak_test.go @@ -0,0 +1,91 @@ +package env_vars + +import ( + "regexp" + "strconv" + "time" + + "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +const ( + ENI_ENDPOINT = "http://localhost:61679/v1/enis" +) + +var _ = Describe("IP Leak Test", func() { + Context("IP Released on Pod Deletion", func() { + It("Verify that on Pod Deletion, Warm Pool State is restored", func() { + totalIps := 0 + assignedIps := 0 + deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("busybox"). + NodeName(primaryNode.Name). + Replicas(10). + Build() + + By("Recording the initial count of IP before new deployment") + { + totalIps, assignedIps = getTotalAndAssignedIps() + } + + By("Deploying a large number of Busybox Deployment") + { + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpec) + + Expect(err).ToNot(HaveOccurred()) + } + + By("Recording the count of IP after deployment") + { + currTotal, currAssigned := getTotalAndAssignedIps() + Expect(currTotal).To(Equal(totalIps)) + // Diff should be equal to number of replicas in new deployment + Expect(currAssigned - assignedIps).To(Equal(10)) + } + + By("Deleting the deployment") + { + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) + Expect(err).NotTo(HaveOccurred()) + } + + By("Validating that count of IP is same as before") + { + ip := 0 + assigned := 0 + for i := 0; i < 3; i++ { + // It takes some time to unassign IP addresses + time.Sleep(120 * time.Second) + ip, assigned = getTotalAndAssignedIps() + if assigned == assignedIps { + break + } + } + Expect(ip).To(Equal(totalIps)) + Expect(assigned).To(Equal(assignedIps)) + } + }) + }) +}) + +func getTotalAndAssignedIps() (int, int) { + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"curl", ENI_ENDPOINT}) + Expect(err).NotTo(HaveOccurred()) + + re := regexp.MustCompile(`\"TotalIPs\":([0-9]*),\"AssignedIPs\":([0-9]*)`) + ipCountStr := re.FindAllStringSubmatch(stdout, -1)[0] + Expect(len(ipCountStr)).To(Equal(3)) + + total, err := strconv.Atoi(ipCountStr[1]) + Expect(err).NotTo(HaveOccurred()) + + assigned, err := strconv.Atoi(ipCountStr[2]) + Expect(err).NotTo(HaveOccurred()) + + return total, assigned +} From f8f6c2dd954d04a1545ac9117536227ebdbeec80 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Fri, 23 Apr 2021 00:24:24 -0700 Subject: [PATCH 05/11] Created a new package for ipamd tests --- test/framework/options.go | 8 -- .../resources/k8s/manifest/container.go | 6 +- .../resources/k8s/manifest/deployment.go | 23 +---- .../cni/env_vars/env_vars_suite_test.go | 95 +++++++++++++++++++ .../env_test.go => env_vars/env_vars_test.go} | 95 ++++++++----------- .../ipamd_suite_test.go} | 13 ++- .../ipleak_test.go => ipamd/ipamd_test.go} | 57 +++++------ 7 files changed, 172 insertions(+), 125 deletions(-) create mode 100644 test/integration-new/cni/env_vars/env_vars_suite_test.go rename test/integration-new/cni/{eni_config/env_test.go => env_vars/env_vars_test.go} (62%) rename test/integration-new/cni/{eni_config/config_suite_test.go => ipamd/ipamd_suite_test.go} (84%) rename test/integration-new/cni/{eni_config/ipleak_test.go => ipamd/ipamd_test.go} (58%) diff --git a/test/framework/options.go b/test/framework/options.go index a8eeea3d2c..12294e938a 100644 --- a/test/framework/options.go +++ b/test/framework/options.go @@ -33,7 +33,6 @@ type Options struct { AWSVPCID string NgNameLabelKey string NgNameLabelVal string - IgnoreOptional bool } func (options *Options) BindFlags() { @@ -58,12 +57,5 @@ func (options *Options) Validate() error { if len(options.AWSVPCID) == 0 { return errors.Errorf("%s must be set!", "aws-vpc-id") } - if !options.IgnoreOptional && len(options.NgNameLabelKey) == 0 { - return errors.Errorf("%s must be set!", "ng-name-label-key") - } - if !options.IgnoreOptional && len(options.NgNameLabelVal) == 0 { - return errors.Errorf("%s must be set!", "ng-name-label-val") - } - return nil } diff --git a/test/framework/resources/k8s/manifest/container.go b/test/framework/resources/k8s/manifest/container.go index 9ee076455d..2cba02f529 100644 --- a/test/framework/resources/k8s/manifest/container.go +++ b/test/framework/resources/k8s/manifest/container.go @@ -25,10 +25,10 @@ type Container struct { args []string } -func NewContainerWithCurlerBuilder() *Container { +func NewBusyBoxContainerBuilder() *Container { return &Container{ - name: "curler", - image: "curlimages/curl:7.76.1", + name: "busybox", + image: "busybox", imagePullPolicy: v1.PullIfNotPresent, command: []string{"sleep", "3600"}, args: []string{}, diff --git a/test/framework/resources/k8s/manifest/deployment.go b/test/framework/resources/k8s/manifest/deployment.go index ffb6ba5547..3683525d0a 100644 --- a/test/framework/resources/k8s/manifest/deployment.go +++ b/test/framework/resources/k8s/manifest/deployment.go @@ -40,7 +40,7 @@ func NewBusyBoxDeploymentBuilder() *DeploymentBuilder { namespace: utils.DefaultTestNamespace, name: "deployment-test", replicas: 10, - container: NewContainerWithCurlerBuilder().Build(), + container: NewBusyBoxContainerBuilder().Build(), labels: map[string]string{"role": "test"}, terminationGracePeriod: 0, } @@ -94,24 +94,9 @@ func (d *DeploymentBuilder) HostNetwork(hostNetwork bool) *DeploymentBuilder { return d } -func (d *DeploymentBuilder) MountVolume(name string, mountpath string) *DeploymentBuilder { - d.volume = []corev1.Volume{ - { - Name: name, - VolumeSource: corev1.VolumeSource{ - HostPath: &corev1.HostPathVolumeSource{ - Path: mountpath, - }, - }, - }, - } - - d.volumeMount = []corev1.VolumeMount{ - { - Name: name, - MountPath: name, - }, - } +func (d *DeploymentBuilder) MountVolume(volume []corev1.Volume, volumeMount []corev1.VolumeMount) *DeploymentBuilder { + d.volume = volume + d.volumeMount = volumeMount return d } diff --git a/test/integration-new/cni/env_vars/env_vars_suite_test.go b/test/integration-new/cni/env_vars/env_vars_suite_test.go new file mode 100644 index 0000000000..acd423034b --- /dev/null +++ b/test/integration-new/cni/env_vars/env_vars_suite_test.go @@ -0,0 +1,95 @@ +package env_vars + +import ( + "testing" + + "github.com/aws/amazon-vpc-cni-k8s/test/framework" + "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + appsV1 "k8s.io/api/apps/v1" + v1 "k8s.io/api/core/v1" +) + +const ( + NAMESPACE = "kube-system" + DAEMONSET = "aws-node" + HOST_POD_LABEL_KEY = "network" + HOST_POD_LABEL_VAL = "host" + VOLUME_NAME = "ipamd-logs" + VOLUME_MOUNT_PATH = "/var/log/aws-routed-eni/" +) + +var ( + primaryNode v1.Node + primaryInstanceId string + ds *appsV1.DaemonSet + f *framework.Framework + hostNetworkDeploymentSpec *appsV1.Deployment + hostNetworkDeployment *appsV1.Deployment + err error + hostNetworkPod v1.Pod +) + +func TestCni(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Cni Suite") +} + +var _ = BeforeSuite(func() { + f = framework.New(framework.GlobalOptions) + ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) + Expect(err).NotTo(HaveOccurred()) + + nodes, err := f.K8sResourceManagers.NodeManager().GetAllNodes() + Expect(err).NotTo(HaveOccurred()) + Expect(len(nodes.Items)).To(BeNumerically(">", 0)) + + primaryNode = nodes.Items[0] + primaryInstanceId = k8sUtils.GetInstanceIDFromNode(primaryNode) + + curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() + + volume := []v1.Volume{ + { + Name: VOLUME_NAME, + VolumeSource: v1.VolumeSource{ + HostPath: &v1.HostPathVolumeSource{ + Path: VOLUME_MOUNT_PATH, + }, + }, + }, + } + + volumeMount := []v1.VolumeMount{ + { + Name: VOLUME_NAME, + MountPath: VOLUME_NAME, + }, + } + hostNetworkDeploymentSpec = manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("host-network"). + Replicas(1). + HostNetwork(true). + PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). + MountVolume(volume, volumeMount). + NodeName(primaryNode.Name). + Build() + + hostNetworkDeployment, err = f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) + Expect(err).NotTo(HaveOccurred()) + + pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL) + Expect(err).NotTo(HaveOccurred()) + + hostNetworkPod = pods.Items[0] +}) + +var _ = AfterSuite(func() { + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) + Expect(err).NotTo(HaveOccurred()) +}) diff --git a/test/integration-new/cni/eni_config/env_test.go b/test/integration-new/cni/env_vars/env_vars_test.go similarity index 62% rename from test/integration-new/cni/eni_config/env_test.go rename to test/integration-new/cni/env_vars/env_vars_test.go index 26c4776d60..3fe3637dde 100644 --- a/test/integration-new/cni/eni_config/env_test.go +++ b/test/integration-new/cni/env_vars/env_vars_test.go @@ -46,64 +46,54 @@ var _ = Describe("cni env test", func() { }) By("Deploying a BusyBox deployment") - { - deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). - Namespace("default"). - Name("busybox"). - Replicas(1). - NodeName(primaryNode.Name). - Build() + deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("busybox"). + Replicas(1). + NodeName(primaryNode.Name). + Build() + + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpec) + Expect(err).ToNot(HaveOccurred()) + + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) + Expect(err).NotTo(HaveOccurred()) - _, err := f.K8sResourceManagers. - DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpec) + re := regexp.MustCompile(`\n`) + input := re.ReplaceAllString(stdout, "") - Expect(err).ToNot(HaveOccurred()) + re = regexp.MustCompile(`eth.*lo`) + eth := re.FindStringSubmatch(input)[0] - stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) - Expect(err).NotTo(HaveOccurred()) + re = regexp.MustCompile(`MTU:[0-9]*`) + mtus := re.FindAllStringSubmatch(eth, -1) - re := regexp.MustCompile(`\n`) - input := re.ReplaceAllString(stdout, "") - - re = regexp.MustCompile(`eth.*lo`) - eth := re.FindStringSubmatch(input)[0] - - re = regexp.MustCompile(`MTU:[0-9]*`) - mtus := re.FindAllStringSubmatch(eth, -1) - - By("Validating new MTU value") - { - // Validate MTU - for _, m := range mtus { - Expect(m[0]).To(Equal("MTU:1300")) - } - } - - By("Validating new VETH Prefix") - { - // Validate VETH Prefix - // Adding the new MTU value to below regex ensures that we are checking the recently created - // veth and not any older entries - re = regexp.MustCompile(`veth.*MTU:1300`) - veth := re.FindAllString(input, -1) - - Expect(len(veth)).NotTo(Equal(0)) - } - - By("Deleting BusyBox Deployment") - { - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) - Expect(err).NotTo(HaveOccurred()) - } + By("Validating new MTU value") + // Validate MTU + for _, m := range mtus { + Expect(m[0]).To(Equal("MTU:1300")) } + + By("Validating new VETH Prefix") + // Validate VETH Prefix + // Adding the new MTU value to below regex ensures that we are checking the recently created + // veth and not any older entries + re = regexp.MustCompile(`veth.*MTU:1300`) + veth := re.FindAllString(input, -1) + + Expect(len(veth)).NotTo(Equal(0)) + + By("Deleting BusyBox Deployment") + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) + Expect(err).NotTo(HaveOccurred()) + By("Restoring old value on daemonset") - { - restoreOldValues(map[string]string{ - AWS_VPC_ENI_MTU: currMTUVal, - AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, - }) - } + restoreOldValues(map[string]string{ + AWS_VPC_ENI_MTU: currMTUVal, + AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, + }) }) It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { @@ -117,7 +107,6 @@ var _ = Describe("cni env test", func() { stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"tail", "-n", "5", "ipamd-logs/ipamd_test.log"}) Expect(err).NotTo(HaveOccurred()) - Expect(stdout).NotTo(Equal("")) By("Restoring old value on daemonset") diff --git a/test/integration-new/cni/eni_config/config_suite_test.go b/test/integration-new/cni/ipamd/ipamd_suite_test.go similarity index 84% rename from test/integration-new/cni/eni_config/config_suite_test.go rename to test/integration-new/cni/ipamd/ipamd_suite_test.go index 013dcdd752..cb98c480db 100644 --- a/test/integration-new/cni/eni_config/config_suite_test.go +++ b/test/integration-new/cni/ipamd/ipamd_suite_test.go @@ -1,4 +1,4 @@ -package env_vars +package ipamd import ( "testing" @@ -36,9 +36,7 @@ func TestCni(t *testing.T) { } var _ = BeforeSuite(func() { - globalOptions := framework.GlobalOptions - globalOptions.IgnoreOptional = true - f = framework.New(globalOptions) + f = framework.New(framework.GlobalOptions) ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) Expect(err).NotTo(HaveOccurred()) @@ -49,17 +47,18 @@ var _ = BeforeSuite(func() { primaryNode = nodes.Items[0] primaryInstanceId = k8sUtils.GetInstanceIDFromNode(primaryNode) - hostNetworkDeploymentSpec = manifest.NewBusyBoxDeploymentBuilder(). + curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() + + hostNetworkDeploymentSpec = manifest.NewDefaultDeploymentBuilder(). Namespace("default"). Name("host-network"). Replicas(1). HostNetwork(true). + Container(curlContainer). PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). NodeName(primaryNode.Name). - MountVolume("ipamd-logs", "/var/log/aws-routed-eni/"). Build() - //f.K8sResourceManagers.DeploymentManager().MountVolume(hostNetworkDeploymentSpec, "ipamd-logs", "/var/log/aws-routed-eni/") hostNetworkDeployment, err = f.K8sResourceManagers. DeploymentManager(). CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) diff --git a/test/integration-new/cni/eni_config/ipleak_test.go b/test/integration-new/cni/ipamd/ipamd_test.go similarity index 58% rename from test/integration-new/cni/eni_config/ipleak_test.go rename to test/integration-new/cni/ipamd/ipamd_test.go index 38428c8a14..dd17657aa5 100644 --- a/test/integration-new/cni/eni_config/ipleak_test.go +++ b/test/integration-new/cni/ipamd/ipamd_test.go @@ -1,4 +1,4 @@ -package env_vars +package ipamd import ( "regexp" @@ -17,8 +17,6 @@ const ( var _ = Describe("IP Leak Test", func() { Context("IP Released on Pod Deletion", func() { It("Verify that on Pod Deletion, Warm Pool State is restored", func() { - totalIps := 0 - assignedIps := 0 deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). Namespace("default"). Name("busybox"). @@ -27,48 +25,37 @@ var _ = Describe("IP Leak Test", func() { Build() By("Recording the initial count of IP before new deployment") - { - totalIps, assignedIps = getTotalAndAssignedIps() - } + totalIps, assignedIps := getTotalAndAssignedIps() By("Deploying a large number of Busybox Deployment") - { - _, err := f.K8sResourceManagers. - DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpec) - - Expect(err).ToNot(HaveOccurred()) - } + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpec) + Expect(err).ToNot(HaveOccurred()) By("Recording the count of IP after deployment") - { - currTotal, currAssigned := getTotalAndAssignedIps() - Expect(currTotal).To(Equal(totalIps)) - // Diff should be equal to number of replicas in new deployment - Expect(currAssigned - assignedIps).To(Equal(10)) - } + currTotal, currAssigned := getTotalAndAssignedIps() + Expect(currTotal).To(Equal(totalIps)) + // Diff should be equal to number of replicas in new deployment + Expect(currAssigned - assignedIps).To(Equal(10)) By("Deleting the deployment") - { - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) - Expect(err).NotTo(HaveOccurred()) - } + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) + Expect(err).NotTo(HaveOccurred()) By("Validating that count of IP is same as before") - { - ip := 0 - assigned := 0 - for i := 0; i < 3; i++ { - // It takes some time to unassign IP addresses - time.Sleep(120 * time.Second) - ip, assigned = getTotalAndAssignedIps() - if assigned == assignedIps { - break - } + ip := 0 + assigned := 0 + for i := 0; i < 3; i++ { + // It takes some time to unassign IP addresses + time.Sleep(120 * time.Second) + ip, assigned = getTotalAndAssignedIps() + if assigned == assignedIps { + break } - Expect(ip).To(Equal(totalIps)) - Expect(assigned).To(Equal(assignedIps)) } + Expect(ip).To(Equal(totalIps)) + Expect(assigned).To(Equal(assignedIps)) }) }) }) From c2e1a13b7a6dfaafbb99b2fa3752f87d93ad45ee Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Fri, 23 Apr 2021 14:05:41 -0700 Subject: [PATCH 06/11] - Use ec2 api instead of ipad api - folder restructuring --- test/integration-new/cni/ipamd/ipamd_test.go | 78 ------------------- .../{cni => }/env_vars/env_vars_suite_test.go | 2 - .../{cni => }/env_vars/env_vars_test.go | 0 .../{cni => }/ipamd/ipamd_suite_test.go | 0 test/integration-new/ipamd/ipamd_test.go | 65 ++++++++++++++++ 5 files changed, 65 insertions(+), 80 deletions(-) delete mode 100644 test/integration-new/cni/ipamd/ipamd_test.go rename test/integration-new/{cni => }/env_vars/env_vars_suite_test.go (95%) rename test/integration-new/{cni => }/env_vars/env_vars_test.go (100%) rename test/integration-new/{cni => }/ipamd/ipamd_suite_test.go (100%) create mode 100644 test/integration-new/ipamd/ipamd_test.go diff --git a/test/integration-new/cni/ipamd/ipamd_test.go b/test/integration-new/cni/ipamd/ipamd_test.go deleted file mode 100644 index dd17657aa5..0000000000 --- a/test/integration-new/cni/ipamd/ipamd_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package ipamd - -import ( - "regexp" - "strconv" - "time" - - "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -const ( - ENI_ENDPOINT = "http://localhost:61679/v1/enis" -) - -var _ = Describe("IP Leak Test", func() { - Context("IP Released on Pod Deletion", func() { - It("Verify that on Pod Deletion, Warm Pool State is restored", func() { - deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). - Namespace("default"). - Name("busybox"). - NodeName(primaryNode.Name). - Replicas(10). - Build() - - By("Recording the initial count of IP before new deployment") - totalIps, assignedIps := getTotalAndAssignedIps() - - By("Deploying a large number of Busybox Deployment") - _, err := f.K8sResourceManagers. - DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpec) - Expect(err).ToNot(HaveOccurred()) - - By("Recording the count of IP after deployment") - currTotal, currAssigned := getTotalAndAssignedIps() - Expect(currTotal).To(Equal(totalIps)) - // Diff should be equal to number of replicas in new deployment - Expect(currAssigned - assignedIps).To(Equal(10)) - - By("Deleting the deployment") - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) - Expect(err).NotTo(HaveOccurred()) - - By("Validating that count of IP is same as before") - ip := 0 - assigned := 0 - for i := 0; i < 3; i++ { - // It takes some time to unassign IP addresses - time.Sleep(120 * time.Second) - ip, assigned = getTotalAndAssignedIps() - if assigned == assignedIps { - break - } - } - Expect(ip).To(Equal(totalIps)) - Expect(assigned).To(Equal(assignedIps)) - }) - }) -}) - -func getTotalAndAssignedIps() (int, int) { - stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"curl", ENI_ENDPOINT}) - Expect(err).NotTo(HaveOccurred()) - - re := regexp.MustCompile(`\"TotalIPs\":([0-9]*),\"AssignedIPs\":([0-9]*)`) - ipCountStr := re.FindAllStringSubmatch(stdout, -1)[0] - Expect(len(ipCountStr)).To(Equal(3)) - - total, err := strconv.Atoi(ipCountStr[1]) - Expect(err).NotTo(HaveOccurred()) - - assigned, err := strconv.Atoi(ipCountStr[2]) - Expect(err).NotTo(HaveOccurred()) - - return total, assigned -} diff --git a/test/integration-new/cni/env_vars/env_vars_suite_test.go b/test/integration-new/env_vars/env_vars_suite_test.go similarity index 95% rename from test/integration-new/cni/env_vars/env_vars_suite_test.go rename to test/integration-new/env_vars/env_vars_suite_test.go index acd423034b..326b4300e0 100644 --- a/test/integration-new/cni/env_vars/env_vars_suite_test.go +++ b/test/integration-new/env_vars/env_vars_suite_test.go @@ -49,8 +49,6 @@ var _ = BeforeSuite(func() { primaryNode = nodes.Items[0] primaryInstanceId = k8sUtils.GetInstanceIDFromNode(primaryNode) - curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() - volume := []v1.Volume{ { Name: VOLUME_NAME, diff --git a/test/integration-new/cni/env_vars/env_vars_test.go b/test/integration-new/env_vars/env_vars_test.go similarity index 100% rename from test/integration-new/cni/env_vars/env_vars_test.go rename to test/integration-new/env_vars/env_vars_test.go diff --git a/test/integration-new/cni/ipamd/ipamd_suite_test.go b/test/integration-new/ipamd/ipamd_suite_test.go similarity index 100% rename from test/integration-new/cni/ipamd/ipamd_suite_test.go rename to test/integration-new/ipamd/ipamd_suite_test.go diff --git a/test/integration-new/ipamd/ipamd_test.go b/test/integration-new/ipamd/ipamd_test.go new file mode 100644 index 0000000000..e6b50f1d11 --- /dev/null +++ b/test/integration-new/ipamd/ipamd_test.go @@ -0,0 +1,65 @@ +package ipamd + +import ( + "time" + + "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" +) + +const ( + ENI_ENDPOINT = "http://localhost:61679/v1/enis" +) + +var _ = Describe("ENI/IP Leak Test", func() { + Context("ENI/IP Released on Pod Deletion", func() { + It("Verify that on Pod Deletion, ENI/IP State is restored", func() { + By("Recording the initial count of IP before new deployment") + oldIP, oldENI := getCountOfIPAndENI(primaryInstanceId) + + deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). + Namespace("default"). + Name("busybox"). + NodeName(primaryNode.Name). + Replicas(17). + Build() + + By("Deploying a large number of Busybox Deployment") + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpec) + Expect(err).ToNot(HaveOccurred()) + + By("Deleting the deployment") + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) + Expect(err).NotTo(HaveOccurred()) + + By("Validating that count of ENI/IP is same as before") + ip := 0 + eni := 0 + for i := 0; i < 3; i++ { + // It takes some time to unassign IP addresses + time.Sleep(120 * time.Second) + ip, eni = getCountOfIPAndENI(primaryInstanceId) + if ip == oldIP { + break + } + } + Expect(ip).To(Equal(oldIP)) + Expect(eni).To(Equal(oldENI)) + }) + }) +}) + +func getCountOfIPAndENI(instanceId string) (int, int) { + instance, err := f.CloudServices.EC2().DescribeInstance(instanceId) + Expect(err).NotTo(HaveOccurred()) + + eni := len(instance.NetworkInterfaces) + ip := 0 + for _, ni := range instance.NetworkInterfaces { + ip += len(ni.PrivateIpAddresses) + } + return eni, ip +} From 1ca751e78a848169014b91ad5cc9ccec8af73cd5 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Tue, 4 May 2021 15:23:12 -0700 Subject: [PATCH 07/11] Address PR comments for ipamd_test file --- test/agent/go.mod | 1 - test/agent/go.sum | 356 ------------------ test/go.mod | 1 + test/go.sum | 2 + .../env_vars/env_vars_suite_test.go | 18 - .../integration-new/env_vars/env_vars_test.go | 109 ++++-- .../integration-new/ipamd/ipamd_suite_test.go | 15 +- test/integration-new/ipamd/ipamd_test.go | 31 +- 8 files changed, 109 insertions(+), 424 deletions(-) diff --git a/test/agent/go.mod b/test/agent/go.mod index d0a12f2367..06d0dc89ba 100644 --- a/test/agent/go.mod +++ b/test/agent/go.mod @@ -3,7 +3,6 @@ module github.com/aws/amazon-vpc-cni-k8s/test/agent go 1.14 require ( - github.com/go-kit/kit v0.10.0 github.com/vishvananda/netlink v1.1.0 golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 ) diff --git a/test/agent/go.sum b/test/agent/go.sum index 48b6901a6c..71f61a9b28 100644 --- a/test/agent/go.sum +++ b/test/agent/go.sum @@ -1,364 +1,8 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444 h1:/d2cWp6PSamH4jDPFLyO150psQdqvtoNX8Zjg3AQ31g= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 h1:sIky/MyNRSHTrdxfsiUSS4WIAMvInbeXljJz+jDjeYE= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887 h1:dXfMednGJh/SUUFjTLsWJz3P+TQt9qnR11GgeI3vWKs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/test/go.mod b/test/go.mod index 555e3cc00d..498f649222 100644 --- a/test/go.mod +++ b/test/go.mod @@ -10,6 +10,7 @@ require ( github.com/onsi/ginkgo v1.12.1 github.com/onsi/gomega v1.11.0 github.com/pkg/errors v0.9.1 + github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 k8s.io/api v0.18.6 k8s.io/apimachinery v0.18.6 k8s.io/client-go v0.18.6 diff --git a/test/go.sum b/test/go.sum index ee29f01cc4..74585c5e73 100644 --- a/test/go.sum +++ b/test/go.sum @@ -525,9 +525,11 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 h1:cPXZWzzG0NllBLdjWoD1nDfaqu98YMv+OneaKc8sPOA= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= diff --git a/test/integration-new/env_vars/env_vars_suite_test.go b/test/integration-new/env_vars/env_vars_suite_test.go index b570db5d0c..eb5a6795d3 100644 --- a/test/integration-new/env_vars/env_vars_suite_test.go +++ b/test/integration-new/env_vars/env_vars_suite_test.go @@ -54,30 +54,12 @@ var _ = BeforeSuite(func() { primaryNodePublicIP = *instance.PublicIpAddress - volume := []v1.Volume{ - { - Name: VOLUME_NAME, - VolumeSource: v1.VolumeSource{ - HostPath: &v1.HostPathVolumeSource{ - Path: VOLUME_MOUNT_PATH, - }, - }, - }, - } - - volumeMount := []v1.VolumeMount{ - { - Name: VOLUME_NAME, - MountPath: VOLUME_NAME, - }, - } hostNetworkDeploymentSpec = manifest.NewBusyBoxDeploymentBuilder(). Namespace("default"). Name("host-network"). Replicas(1). HostNetwork(true). PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). - MountVolume(volume, volumeMount). NodeName(primaryNode.Name). Build() diff --git a/test/integration-new/env_vars/env_vars_test.go b/test/integration-new/env_vars/env_vars_test.go index 5115857001..206a23ed8b 100644 --- a/test/integration-new/env_vars/env_vars_test.go +++ b/test/integration-new/env_vars/env_vars_test.go @@ -1,11 +1,11 @@ package env_vars import ( - "fmt" - "net" + "regexp" "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" + v1 "k8s.io/api/core/v1" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -15,6 +15,8 @@ const ( AWS_VPC_ENI_MTU = "AWS_VPC_ENI_MTU" AWS_VPC_K8S_CNI_LOG_FILE = "AWS_VPC_K8S_CNI_LOG_FILE" AWS_VPC_K8S_CNI_VETHPREFIX = "AWS_VPC_K8S_CNI_VETHPREFIX" + POD_VOL_LABEL_KEY = "MountVolume" + POD_VOL_LABEL_VAL = "true" ) var _ = Describe("cni env test", func() { @@ -59,42 +61,32 @@ var _ = Describe("cni env test", func() { CreateAndWaitTillDeploymentIsReady(deploymentSpec) Expect(err).ToNot(HaveOccurred()) - conn, err := net.Dial("tcp", primaryNodePublicIP) + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) Expect(err).NotTo(HaveOccurred()) - interfaces, err := net.Interfaces() - Expect(err).NotTo(HaveOccurred()) - - for _, ni := range interfaces { - fmt.Printf("Name:%s, MTU: %d\n", ni.Name, ni.MTU) - } - - // stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) - // Expect(err).NotTo(HaveOccurred()) + re := regexp.MustCompile(`\n`) + input := re.ReplaceAllString(stdout, "") - // re := regexp.MustCompile(`\n`) - // input := re.ReplaceAllString(stdout, "") + re = regexp.MustCompile(`eth.*lo`) + eth := re.FindStringSubmatch(input)[0] - // re = regexp.MustCompile(`eth.*lo`) - // eth := re.FindStringSubmatch(input)[0] + re = regexp.MustCompile(`MTU:[0-9]*`) + mtus := re.FindAllStringSubmatch(eth, -1) - // re = regexp.MustCompile(`MTU:[0-9]*`) - // mtus := re.FindAllStringSubmatch(eth, -1) - - // By("Validating new MTU value") - // // Validate MTU - // for _, m := range mtus { - // Expect(m[0]).To(Equal("MTU:1300")) - // } + By("Validating new MTU value") + // Validate MTU + for _, m := range mtus { + Expect(m[0]).To(Equal("MTU:1300")) + } - // By("Validating new VETH Prefix") - // // Validate VETH Prefix - // // Adding the new MTU value to below regex ensures that we are checking the recently created - // // veth and not any older entries - // re = regexp.MustCompile(`veth.*MTU:1300`) - // veth := re.FindAllString(input, -1) + By("Validating new VETH Prefix") + // Validate VETH Prefix + // Adding the new MTU value to below regex ensures that we are checking the recently created + // veth and not any older entries + re = regexp.MustCompile(`veth.*MTU:1300`) + veth := re.FindAllString(input, -1) - // Expect(len(veth)).NotTo(Equal(0)) + Expect(len(veth)).NotTo(Equal(0)) By("Deleting BusyBox Deployment") err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpec) @@ -108,6 +100,47 @@ var _ = Describe("cni env test", func() { }) It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { + By("Deploying a host network deployment with Volume mount") + curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() + + volume := []v1.Volume{ + { + Name: VOLUME_NAME, + VolumeSource: v1.VolumeSource{ + HostPath: &v1.HostPathVolumeSource{ + Path: VOLUME_MOUNT_PATH, + }, + }, + }, + } + + volumeMount := []v1.VolumeMount{ + { + Name: VOLUME_NAME, + MountPath: VOLUME_NAME, + }, + } + + deploymentSpecWithVol := manifest.NewDefaultDeploymentBuilder(). + Namespace("default"). + Name("host-network"). + Replicas(1). + HostNetwork(true). + Container(curlContainer). + PodLabel(POD_VOL_LABEL_KEY, POD_VOL_LABEL_VAL). + MountVolume(volume, volumeMount). + NodeName(primaryNode.Name). + Build() + + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(deploymentSpecWithVol) + Expect(err).NotTo(HaveOccurred()) + + pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(POD_VOL_LABEL_KEY, POD_VOL_LABEL_VAL) + Expect(err).NotTo(HaveOccurred()) + + podWithVol := pods.Items[0] currLogFilepath := getEnvValueForKey(AWS_VPC_K8S_CNI_LOG_FILE) Expect(currLogFilepath).NotTo(Equal("")) @@ -116,16 +149,18 @@ var _ = Describe("cni env test", func() { AWS_VPC_K8S_CNI_LOG_FILE: "/host/var/log/aws-routed-eni/" + newLogFile, }) - stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"tail", "-n", "5", "ipamd-logs/ipamd_test.log"}) + stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", podWithVol.Name, []string{"tail", "-n", "5", "ipamd-logs/ipamd_test.log"}) Expect(err).NotTo(HaveOccurred()) Expect(stdout).NotTo(Equal("")) By("Restoring old value on daemonset") - { - restoreOldValues(map[string]string{ - AWS_VPC_K8S_CNI_LOG_FILE: currLogFilepath, - }) - } + restoreOldValues(map[string]string{ + AWS_VPC_K8S_CNI_LOG_FILE: currLogFilepath, + }) + + By("Deleing deployment with Volume Mount") + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) + Expect(err).NotTo(HaveOccurred()) }) }) }) diff --git a/test/integration-new/ipamd/ipamd_suite_test.go b/test/integration-new/ipamd/ipamd_suite_test.go index ac378f40d2..b8d6ca17ec 100644 --- a/test/integration-new/ipamd/ipamd_suite_test.go +++ b/test/integration-new/ipamd/ipamd_suite_test.go @@ -42,6 +42,7 @@ var ( err error hostNetworkPod v1.Pod primaryInstance *ec2.Instance + numOfNodes int ) func TestIPAMD(t *testing.T) { @@ -54,10 +55,11 @@ var _ = BeforeSuite(func() { ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) Expect(err).NotTo(HaveOccurred()) - nodeList, err := f.K8sResourceManagers.NodeManager().GetNodes(f.Options.NgNameLabelKey, - f.Options.NgNameLabelVal) + nodeList, err := f.K8sResourceManagers.NodeManager().GetAllNodes() Expect(err).ToNot(HaveOccurred()) - Expect(len(nodeList.Items)).Should(BeNumerically(">", 1)) + + numOfNodes = len(nodeList.Items) + Expect(numOfNodes).Should(BeNumerically(">", 1)) // Nominate the first node as the primary node primaryNode = nodeList.Items[0] @@ -87,9 +89,16 @@ var _ = BeforeSuite(func() { Expect(err).NotTo(HaveOccurred()) hostNetworkPod = pods.Items[0] + + // Set the WARM_ENI_TARGET to 0 to prevent all pods being scheduled on secondary ENI + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", + "aws-node", map[string]string{"WARM_IP_TARGET": "3", "WARM_ENI_TARGET": "0"}) }) var _ = AfterSuite(func() { err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) Expect(err).NotTo(HaveOccurred()) + + k8sUtils.RemoveVarFromDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", + "aws-node", map[string]struct{}{"WARM_IP_TARGET": {}, "WARM_ENI_TARGET": {}}) }) diff --git a/test/integration-new/ipamd/ipamd_test.go b/test/integration-new/ipamd/ipamd_test.go index e6b50f1d11..25714af2fa 100644 --- a/test/integration-new/ipamd/ipamd_test.go +++ b/test/integration-new/ipamd/ipamd_test.go @@ -14,18 +14,19 @@ const ( var _ = Describe("ENI/IP Leak Test", func() { Context("ENI/IP Released on Pod Deletion", func() { - It("Verify that on Pod Deletion, ENI/IP State is restored", func() { + FIt("Verify that on Pod Deletion, ENI/IP State is restored", func() { By("Recording the initial count of IP before new deployment") oldIP, oldENI := getCountOfIPAndENI(primaryInstanceId) + maxPods := getMaxApplicationPodsOnPrimaryInstance() deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). Namespace("default"). Name("busybox"). NodeName(primaryNode.Name). - Replicas(17). + Replicas(int(maxPods)). Build() - By("Deploying a large number of Busybox Deployment") + By("Deploying a max number of Busybox pods") _, err := f.K8sResourceManagers. DeploymentManager(). CreateAndWaitTillDeploymentIsReady(deploymentSpec) @@ -53,13 +54,25 @@ var _ = Describe("ENI/IP Leak Test", func() { }) func getCountOfIPAndENI(instanceId string) (int, int) { - instance, err := f.CloudServices.EC2().DescribeInstance(instanceId) - Expect(err).NotTo(HaveOccurred()) - - eni := len(instance.NetworkInterfaces) + eni := len(primaryInstance.NetworkInterfaces) ip := 0 - for _, ni := range instance.NetworkInterfaces { + for _, ni := range primaryInstance.NetworkInterfaces { ip += len(ni.PrivateIpAddresses) } - return eni, ip + return ip, eni +} + +func getMaxApplicationPodsOnPrimaryInstance() int64 { + instanceType := primaryInstance.InstanceType + instaceInfo, err := f.CloudServices.EC2().DescribeInstanceType(*instanceType) + Expect(err).NotTo(HaveOccurred()) + + currInstance := instaceInfo[0] + maxENI := currInstance.NetworkInfo.MaximumNetworkInterfaces + maxIPPerENI := currInstance.NetworkInfo.Ipv4AddressesPerInterface + + // If core-dns pods are running on this instance then we need to exclude them as well + // additional 1 for hostNetworkPod scheduled in beforesuite + maxPods := *maxENI*(*maxIPPerENI-1) - int64(numOfNodes) - 1 + return maxPods } From f651ef2a674e6ec47ab7d72b9a6acbc3807928b2 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Tue, 4 May 2021 15:36:52 -0700 Subject: [PATCH 08/11] minor change --- test/integration-new/ipamd/ipamd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration-new/ipamd/ipamd_test.go b/test/integration-new/ipamd/ipamd_test.go index 25714af2fa..75ae09f7b3 100644 --- a/test/integration-new/ipamd/ipamd_test.go +++ b/test/integration-new/ipamd/ipamd_test.go @@ -14,7 +14,7 @@ const ( var _ = Describe("ENI/IP Leak Test", func() { Context("ENI/IP Released on Pod Deletion", func() { - FIt("Verify that on Pod Deletion, ENI/IP State is restored", func() { + It("Verify that on Pod Deletion, ENI/IP State is restored", func() { By("Recording the initial count of IP before new deployment") oldIP, oldENI := getCountOfIPAndENI(primaryInstanceId) From 5c548aeb9df479205bf8b46a47280d599897ef87 Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Wed, 5 May 2021 13:41:29 -0700 Subject: [PATCH 09/11] Restructured files Removed unnecessary tests Addressed PR comments --- .../framework/resources/k8s/resources/node.go | 3 + .../env_vars/env_vars_suite_test.go | 80 ------------------- .../{env_vars => ipamd}/env_vars_test.go | 78 ++++++++++++------ .../integration-new/ipamd/ipamd_suite_test.go | 66 ++------------- test/integration-new/ipamd/ipamd_test.go | 27 +++++-- 5 files changed, 86 insertions(+), 168 deletions(-) delete mode 100644 test/integration-new/env_vars/env_vars_suite_test.go rename test/integration-new/{env_vars => ipamd}/env_vars_test.go (70%) diff --git a/test/framework/resources/k8s/resources/node.go b/test/framework/resources/k8s/resources/node.go index e07b90d673..5dec84ed86 100644 --- a/test/framework/resources/k8s/resources/node.go +++ b/test/framework/resources/k8s/resources/node.go @@ -39,6 +39,9 @@ func NewDefaultNodeManager(k8sClient client.DelegatingClient) NodeManager { } func (d *defaultNodeManager) GetNodes(nodeLabelKey string, nodeLabelVal string) (v1.NodeList, error) { + if nodeLabelVal == "" { + return d.GetAllNodes() + } ctx := context.Background() nodeList := v1.NodeList{} err := d.k8sClient.List(ctx, &nodeList, client.MatchingLabels{ diff --git a/test/integration-new/env_vars/env_vars_suite_test.go b/test/integration-new/env_vars/env_vars_suite_test.go deleted file mode 100644 index eb5a6795d3..0000000000 --- a/test/integration-new/env_vars/env_vars_suite_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package env_vars - -import ( - "testing" - - "github.com/aws/amazon-vpc-cni-k8s/test/framework" - "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" - k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - appsV1 "k8s.io/api/apps/v1" - v1 "k8s.io/api/core/v1" -) - -const ( - NAMESPACE = "kube-system" - DAEMONSET = "aws-node" - HOST_POD_LABEL_KEY = "network" - HOST_POD_LABEL_VAL = "host" - VOLUME_NAME = "ipamd-logs" - VOLUME_MOUNT_PATH = "/var/log/aws-routed-eni/" -) - -var ( - primaryNode v1.Node - primaryInstanceId string - ds *appsV1.DaemonSet - f *framework.Framework - hostNetworkDeploymentSpec *appsV1.Deployment - hostNetworkDeployment *appsV1.Deployment - err error - hostNetworkPod v1.Pod - primaryNodePublicIP string -) - -func TestCni(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Cni Suite") -} - -var _ = BeforeSuite(func() { - f = framework.New(framework.GlobalOptions) - ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) - Expect(err).NotTo(HaveOccurred()) - - nodes, err := f.K8sResourceManagers.NodeManager().GetAllNodes() - Expect(err).NotTo(HaveOccurred()) - Expect(len(nodes.Items)).To(BeNumerically(">", 0)) - - primaryNode = nodes.Items[0] - primaryInstanceId = k8sUtils.GetInstanceIDFromNode(primaryNode) - instance, err := f.CloudServices.EC2().DescribeInstance(primaryInstanceId) - Expect(err).NotTo(HaveOccurred()) - - primaryNodePublicIP = *instance.PublicIpAddress - - hostNetworkDeploymentSpec = manifest.NewBusyBoxDeploymentBuilder(). - Namespace("default"). - Name("host-network"). - Replicas(1). - HostNetwork(true). - PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). - NodeName(primaryNode.Name). - Build() - - hostNetworkDeployment, err = f.K8sResourceManagers. - DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) - Expect(err).NotTo(HaveOccurred()) - - pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL) - Expect(err).NotTo(HaveOccurred()) - - hostNetworkPod = pods.Items[0] -}) - -var _ = AfterSuite(func() { - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/test/integration-new/env_vars/env_vars_test.go b/test/integration-new/ipamd/env_vars_test.go similarity index 70% rename from test/integration-new/env_vars/env_vars_test.go rename to test/integration-new/ipamd/env_vars_test.go index 206a23ed8b..27316d1f92 100644 --- a/test/integration-new/env_vars/env_vars_test.go +++ b/test/integration-new/ipamd/env_vars_test.go @@ -1,14 +1,21 @@ -package env_vars +package ipamd import ( "regexp" "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" - v1 "k8s.io/api/core/v1" - + "github.com/aws/amazon-vpc-cni-k8s/test/framework/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + appsV1 "k8s.io/api/apps/v1" + v1 "k8s.io/api/core/v1" +) + +var ( + ds *appsV1.DaemonSet + hostNetworkDeploymentSpec *appsV1.Deployment + hostNetworkPod v1.Pod ) const ( @@ -17,26 +24,15 @@ const ( AWS_VPC_K8S_CNI_VETHPREFIX = "AWS_VPC_K8S_CNI_VETHPREFIX" POD_VOL_LABEL_KEY = "MountVolume" POD_VOL_LABEL_VAL = "true" + VOLUME_NAME = "ipamd-logs" + VOLUME_MOUNT_PATH = "/var/log/aws-routed-eni/" ) var _ = Describe("cni env test", func() { - Context("CNI Environment Variables", func() { - It("Verifying that secondary ENI is created", func() { - nodes, err := f.K8sResourceManagers.NodeManager().GetAllNodes() - Expect(err).NotTo(HaveOccurred()) - - for _, node := range nodes.Items { - instanceId := k8sUtils.GetInstanceIDFromNode(node) - instance, err := f.CloudServices.EC2().DescribeInstance(instanceId) - Expect(err).NotTo(HaveOccurred()) - - len := len(instance.NetworkInterfaces) - Expect(len).To(BeNumerically(">=", 2)) - } - }) + It("Changing AWS_VPC_ENI_MTU and AWS_VPC_K8S_CNI_VETHPREFIX", func() { + setupHostNetworkPod() - FIt("Changing AWS_VPC_ENI_MTU and AWS_VPC_K8S_CNI_VETHPREFIX", func() { currMTUVal := getEnvValueForKey(AWS_VPC_ENI_MTU) Expect(currMTUVal).NotTo(Equal("")) @@ -58,7 +54,7 @@ var _ = Describe("cni env test", func() { _, err := f.K8sResourceManagers. DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpec) + CreateAndWaitTillDeploymentIsReady(deploymentSpec, utils.DefaultDeploymentReadyTimeout) Expect(err).ToNot(HaveOccurred()) stdout, _, err := f.K8sResourceManagers.PodManager().PodExec("default", hostNetworkPod.Name, []string{"ifconfig"}) @@ -97,9 +93,10 @@ var _ = Describe("cni env test", func() { AWS_VPC_ENI_MTU: currMTUVal, AWS_VPC_K8S_CNI_VETHPREFIX: currVETHPrefix, }) + cleanupHostNetworkPod() }) - It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { + FIt("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { By("Deploying a host network deployment with Volume mount") curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() @@ -134,11 +131,12 @@ var _ = Describe("cni env test", func() { _, err := f.K8sResourceManagers. DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpecWithVol) - Expect(err).NotTo(HaveOccurred()) + CreateAndWaitTillDeploymentIsReady(deploymentSpecWithVol, utils.DefaultDeploymentReadyTimeout) + Expect(err).ToNot(HaveOccurred()) pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(POD_VOL_LABEL_KEY, POD_VOL_LABEL_VAL) Expect(err).NotTo(HaveOccurred()) + Expect(len(pods.Items)).Should(BeNumerically(">", 0)) podWithVol := pods.Items[0] currLogFilepath := getEnvValueForKey(AWS_VPC_K8S_CNI_LOG_FILE) @@ -159,13 +157,16 @@ var _ = Describe("cni env test", func() { }) By("Deleing deployment with Volume Mount") - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) + err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(deploymentSpecWithVol) Expect(err).NotTo(HaveOccurred()) }) }) }) func getEnvValueForKey(key string) string { + ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) + Expect(err).NotTo(HaveOccurred()) + envVar := ds.Spec.Template.Spec.Containers[0].Env for _, env := range envVar { if env.Name == key { @@ -175,6 +176,37 @@ func getEnvValueForKey(key string) string { return "" } +func setupHostNetworkPod() { + By("Deploying a Host Network Pod") + curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() + + hostNetworkDeploymentSpec = manifest.NewDefaultDeploymentBuilder(). + Namespace("default"). + Name("host-network"). + Replicas(1). + HostNetwork(true). + Container(curlContainer). + PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). + NodeName(primaryNode.Name). + Build() + + _, err := f.K8sResourceManagers. + DeploymentManager(). + CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec, utils.DefaultDeploymentReadyTimeout) + Expect(err).NotTo(HaveOccurred()) + + pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL) + Expect(err).NotTo(HaveOccurred()) + + hostNetworkPod = pods.Items[0] +} + +func cleanupHostNetworkPod() { + err = f.K8sResourceManagers.DeploymentManager(). + DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) + Expect(err).ToNot(HaveOccurred()) +} + func restoreOldValues(oldVals map[string]string) { k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, DAEMONSET, NAMESPACE, DAEMONSET, oldVals) } diff --git a/test/integration-new/ipamd/ipamd_suite_test.go b/test/integration-new/ipamd/ipamd_suite_test.go index b8d6ca17ec..1731b1cdf7 100644 --- a/test/integration-new/ipamd/ipamd_suite_test.go +++ b/test/integration-new/ipamd/ipamd_suite_test.go @@ -10,40 +10,25 @@ // 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 ipamd import ( "testing" "github.com/aws/amazon-vpc-cni-k8s/test/framework" - "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" "github.com/aws/aws-sdk-go/service/ec2" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - appsV1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" ) -const ( - NAMESPACE = "kube-system" - DAEMONSET = "aws-node" - HOST_POD_LABEL_KEY = "network" - HOST_POD_LABEL_VAL = "host" -) - -var ( - primaryNode v1.Node - primaryInstanceId string - ds *appsV1.DaemonSet - f *framework.Framework - hostNetworkDeploymentSpec *appsV1.Deployment - hostNetworkDeployment *appsV1.Deployment - err error - hostNetworkPod v1.Pod - primaryInstance *ec2.Instance - numOfNodes int -) +var err error +var f *framework.Framework +var primaryNode v1.Node +var primaryInstance *ec2.Instance +var numOfNodes int func TestIPAMD(t *testing.T) { RegisterFailHandler(Fail) @@ -52,10 +37,9 @@ func TestIPAMD(t *testing.T) { var _ = BeforeSuite(func() { f = framework.New(framework.GlobalOptions) - ds, err = f.K8sResourceManagers.DaemonSetManager().GetDaemonSet(NAMESPACE, DAEMONSET) - Expect(err).NotTo(HaveOccurred()) - nodeList, err := f.K8sResourceManagers.NodeManager().GetAllNodes() + nodeList, err := f.K8sResourceManagers.NodeManager().GetNodes(f.Options.NgNameLabelKey, + f.Options.NgNameLabelVal) Expect(err).ToNot(HaveOccurred()) numOfNodes = len(nodeList.Items) @@ -67,38 +51,4 @@ var _ = BeforeSuite(func() { instanceID := k8sUtils.GetInstanceIDFromNode(primaryNode) primaryInstance, err = f.CloudServices.EC2().DescribeInstance(instanceID) Expect(err).ToNot(HaveOccurred()) - - curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() - - hostNetworkDeploymentSpec = manifest.NewDefaultDeploymentBuilder(). - Namespace("default"). - Name("host-network"). - Replicas(1). - HostNetwork(true). - Container(curlContainer). - PodLabel(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL). - NodeName(primaryNode.Name). - Build() - - hostNetworkDeployment, err = f.K8sResourceManagers. - DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(hostNetworkDeploymentSpec) - Expect(err).NotTo(HaveOccurred()) - - pods, err := f.K8sResourceManagers.PodManager().GetPodsWithLabelSelector(HOST_POD_LABEL_KEY, HOST_POD_LABEL_VAL) - Expect(err).NotTo(HaveOccurred()) - - hostNetworkPod = pods.Items[0] - - // Set the WARM_ENI_TARGET to 0 to prevent all pods being scheduled on secondary ENI - k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", - "aws-node", map[string]string{"WARM_IP_TARGET": "3", "WARM_ENI_TARGET": "0"}) -}) - -var _ = AfterSuite(func() { - err = f.K8sResourceManagers.DeploymentManager().DeleteAndWaitTillDeploymentIsDeleted(hostNetworkDeploymentSpec) - Expect(err).NotTo(HaveOccurred()) - - k8sUtils.RemoveVarFromDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", - "aws-node", map[string]struct{}{"WARM_IP_TARGET": {}, "WARM_ENI_TARGET": {}}) }) diff --git a/test/integration-new/ipamd/ipamd_test.go b/test/integration-new/ipamd/ipamd_test.go index 75ae09f7b3..65fe661eed 100644 --- a/test/integration-new/ipamd/ipamd_test.go +++ b/test/integration-new/ipamd/ipamd_test.go @@ -4,19 +4,29 @@ import ( "time" "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/manifest" + k8sUtils "github.com/aws/amazon-vpc-cni-k8s/test/framework/resources/k8s/utils" + "github.com/aws/amazon-vpc-cni-k8s/test/framework/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) const ( - ENI_ENDPOINT = "http://localhost:61679/v1/enis" + NAMESPACE = "kube-system" + DAEMONSET = "aws-node" + HOST_POD_LABEL_KEY = "network" + HOST_POD_LABEL_VAL = "host" ) var _ = Describe("ENI/IP Leak Test", func() { Context("ENI/IP Released on Pod Deletion", func() { It("Verify that on Pod Deletion, ENI/IP State is restored", func() { + // Set the WARM_ENI_TARGET to 0 to prevent all pods being scheduled on secondary ENI + By("Setting WARM_ENI_TARGET to 0") + k8sUtils.AddEnvVarToDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", + "aws-node", map[string]string{"WARM_IP_TARGET": "3", "WARM_ENI_TARGET": "0"}) + By("Recording the initial count of IP before new deployment") - oldIP, oldENI := getCountOfIPAndENI(primaryInstanceId) + oldIP, oldENI := getCountOfIPandENIOnPrimaryInstance() maxPods := getMaxApplicationPodsOnPrimaryInstance() deploymentSpec := manifest.NewBusyBoxDeploymentBuilder(). @@ -29,7 +39,7 @@ var _ = Describe("ENI/IP Leak Test", func() { By("Deploying a max number of Busybox pods") _, err := f.K8sResourceManagers. DeploymentManager(). - CreateAndWaitTillDeploymentIsReady(deploymentSpec) + CreateAndWaitTillDeploymentIsReady(deploymentSpec, utils.DefaultDeploymentReadyTimeout*5) Expect(err).ToNot(HaveOccurred()) By("Deleting the deployment") @@ -42,18 +52,22 @@ var _ = Describe("ENI/IP Leak Test", func() { for i := 0; i < 3; i++ { // It takes some time to unassign IP addresses time.Sleep(120 * time.Second) - ip, eni = getCountOfIPAndENI(primaryInstanceId) + ip, eni = getCountOfIPandENIOnPrimaryInstance() if ip == oldIP { break } } Expect(ip).To(Equal(oldIP)) Expect(eni).To(Equal(oldENI)) + + By("Restoring WARM ENI Target value") + k8sUtils.RemoveVarFromDaemonSetAndWaitTillUpdated(f, "aws-node", "kube-system", + "aws-node", map[string]struct{}{"WARM_IP_TARGET": {}, "WARM_ENI_TARGET": {}}) }) }) }) -func getCountOfIPAndENI(instanceId string) (int, int) { +func getCountOfIPandENIOnPrimaryInstance() (int, int) { eni := len(primaryInstance.NetworkInterfaces) ip := 0 for _, ni := range primaryInstance.NetworkInterfaces { @@ -72,7 +86,6 @@ func getMaxApplicationPodsOnPrimaryInstance() int64 { maxIPPerENI := currInstance.NetworkInfo.Ipv4AddressesPerInterface // If core-dns pods are running on this instance then we need to exclude them as well - // additional 1 for hostNetworkPod scheduled in beforesuite - maxPods := *maxENI*(*maxIPPerENI-1) - int64(numOfNodes) - 1 + maxPods := *maxENI*(*maxIPPerENI-1) - int64(numOfNodes) return maxPods } From 983c3a66aedc38062842340e0973e1542750c58d Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Wed, 5 May 2021 13:44:07 -0700 Subject: [PATCH 10/11] Removed Focus for specific test --- test/integration-new/ipamd/env_vars_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration-new/ipamd/env_vars_test.go b/test/integration-new/ipamd/env_vars_test.go index 27316d1f92..32f0de50e2 100644 --- a/test/integration-new/ipamd/env_vars_test.go +++ b/test/integration-new/ipamd/env_vars_test.go @@ -96,7 +96,7 @@ var _ = Describe("cni env test", func() { cleanupHostNetworkPod() }) - FIt("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { + It("Changing AWS_VPC_K8S_CNI_LOG_FILE", func() { By("Deploying a host network deployment with Volume mount") curlContainer := manifest.NewBusyBoxContainerBuilder().Image("curlimages/curl:7.76.1").Name("curler").Build() From d2121fb27c3cde03c039c42d576e547f8a1dcd1d Mon Sep 17 00:00:00 2001 From: Chinmay Gadgil Date: Thu, 6 May 2021 00:25:38 -0700 Subject: [PATCH 11/11] Updated test file name --- test/integration-new/ipamd/{ipamd_test.go => eni_ip_leak_test.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/integration-new/ipamd/{ipamd_test.go => eni_ip_leak_test.go} (100%) diff --git a/test/integration-new/ipamd/ipamd_test.go b/test/integration-new/ipamd/eni_ip_leak_test.go similarity index 100% rename from test/integration-new/ipamd/ipamd_test.go rename to test/integration-new/ipamd/eni_ip_leak_test.go