From 407bd6a4afa5f7d7cb2a596dda09cacc30828f09 Mon Sep 17 00:00:00 2001 From: Fabian Fulga <63088740+fabi200123@users.noreply.github.com> Date: Wed, 21 Dec 2022 18:07:27 +0200 Subject: [PATCH] Revert "Add e2e tests for node log viewer" (#114636) This reverts commit ff92963551062af6fa94f2e21af9a66061b0056b. --- test/e2e/node/kubelet.go | 79 ---------------------------------------- 1 file changed, 79 deletions(-) diff --git a/test/e2e/node/kubelet.go b/test/e2e/node/kubelet.go index b34853dfb9a..0f46a79ff67 100644 --- a/test/e2e/node/kubelet.go +++ b/test/e2e/node/kubelet.go @@ -19,7 +19,6 @@ package node import ( "context" "fmt" - "os/exec" "path/filepath" "strings" "time" @@ -451,82 +450,4 @@ var _ = SIGDescribe("kubelet", func() { } }) }) - - //Test kubectl alpha node-logs commands - ginkgo.Describe("kubectl node-logs [Feature:add node log viewer]", func() { - var ( - numNodes int - nodeNames sets.String - ) - - ginkgo.BeforeEach(func(ctx context.Context) { - nodes, err := e2enode.GetBoundedReadySchedulableNodes(ctx, c, maxNodesToCheck) - numNodes = len(nodes.Items) - framework.ExpectNoError(err) - nodeNames = sets.NewString() - for i := 0; i < numNodes; i++ { - nodeNames.Insert(nodes.Items[i].Name) - } - }) - - /* - Test if kubectl node-logs - returns something or not! - */ - - ginkgo.It("should return the logs ", func(ctx context.Context) { - ginkgo.By("Starting the command") - tk := e2ekubectl.NewTestKubeconfig(framework.TestContext.CertDir, framework.TestContext.Host, framework.TestContext.KubeConfig, framework.TestContext.KubeContext, framework.TestContext.KubectlPath, ns) - - for nodeName := range nodeNames { - cmd := tk.KubectlCmd("alpha", "node-logs", nodeName) - runKubectlCommand(cmd, "") - } - }) - - /* - Test if kubectl node-logs --service kubelet - returns something or not! - */ - - ginkgo.It("should return the logs for the requested service", func(ctx context.Context) { - ginkgo.By("Starting the command") - tk := e2ekubectl.NewTestKubeconfig(framework.TestContext.CertDir, framework.TestContext.Host, framework.TestContext.KubeConfig, framework.TestContext.KubeContext, framework.TestContext.KubectlPath, ns) - - for nodeName := range nodeNames { - cmd := tk.KubectlCmd("alpha", "node-logs", nodeName, "--service", "kubelet") - runKubectlCommand(cmd, "--service") - } - }) - - /* - Test if kubectl node-logs --path pods - returns something or not! - */ - - ginkgo.It("should return the logs for the provided path", func(ctx context.Context) { - ginkgo.By("Starting the command") - tk := e2ekubectl.NewTestKubeconfig(framework.TestContext.CertDir, framework.TestContext.Host, framework.TestContext.KubeConfig, framework.TestContext.KubeContext, framework.TestContext.KubectlPath, ns) - - for nodeName := range nodeNames { - cmd := tk.KubectlCmd("alpha", "node-logs", nodeName, "--path", "pods") - runKubectlCommand(cmd, "--path") - } - }) - }) }) - -func runKubectlCommand(cmd *exec.Cmd, arg string) { - stdout, stderr, err := framework.StartCmdAndStreamOutput(cmd) - if err != nil { - framework.Failf("Failed to start kubectl command: %v", err) - } - defer stdout.Close() - defer stderr.Close() - defer framework.TryKill(cmd) - buf := make([]byte, 128) - if _, err = stdout.Read(buf); err != nil { - framework.Failf("Expected output from kubectl alpha node-logs %s: %v", arg, err) - } - framework.Logf("output: %s", buf) -}