From 3804a0f2b9d4e2c023dd2b8cc31692b5858ffd22 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 8 Apr 2025 20:47:00 +0000 Subject: [PATCH] Silence vagrant progress output Add --no-tty flag to all `vagrant up` commands to silence the printing of box loading progress Signed-off-by: Brad Davidson (cherry picked from commit 08c6c7423b91ec699793e970eb75fc620dc85284) Signed-off-by: Brad Davidson --- .github/workflows/install.yaml | 2 +- .github/workflows/nightly-install.yaml | 4 ++-- tests/e2e/splitserver/splitserver_test.go | 4 ++-- tests/e2e/testutils.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index b997908d84..10b9f7313b 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -57,7 +57,7 @@ jobs: name: k3s path: tests/install/${{ matrix.vm }} - name: "Vagrant Up" - run: vagrant up --no-provision + run: vagrant up --no-tty --no-provision - name: "Upload k3s binary to VM" run: | chmod +x k3s diff --git a/.github/workflows/nightly-install.yaml b/.github/workflows/nightly-install.yaml index a721678bf4..39592129c6 100644 --- a/.github/workflows/nightly-install.yaml +++ b/.github/workflows/nightly-install.yaml @@ -39,7 +39,7 @@ jobs: - name: "Vagrant Plugin(s)" run: vagrant plugin install vagrant-k3s vagrant-reload - name: "Vagrant Up ⏩ Install K3s" - run: vagrant up + run: vagrant up --no-tty - name: "⏳ Node" run: vagrant provision --provision-with=k3s-wait-for-node - name: "⏳ CoreDNS" @@ -56,4 +56,4 @@ jobs: - name: "k3s-status" run: vagrant provision --provision-with=k3s-status - name: "k3s-procps" - run: vagrant provision --provision-with=k3s-procps \ No newline at end of file + run: vagrant provision --provision-with=k3s-procps diff --git a/tests/e2e/splitserver/splitserver_test.go b/tests/e2e/splitserver/splitserver_test.go index 8ec77a4d86..7c338b13a8 100644 --- a/tests/e2e/splitserver/splitserver_test.go +++ b/tests/e2e/splitserver/splitserver_test.go @@ -63,7 +63,7 @@ func createSplitCluster(nodeOS string, etcdCount, controlPlaneCount, agentCount // Provision the first etcd node. In GitHub Actions, this also imports the VM image into libvirt, which // takes time and can cause the next vagrant up to fail if it is not given enough time to complete. - cmd := fmt.Sprintf(`E2E_NODE_ROLES="%s" E2E_NODE_BOXES="%s" vagrant up --no-provision %s &> vagrant.log`, nodeRoles, nodeBoxes, etcdNodes[0].String()) + cmd := fmt.Sprintf(`E2E_NODE_ROLES="%s" E2E_NODE_BOXES="%s" vagrant up --no-tty --no-provision %s &> vagrant.log`, nodeRoles, nodeBoxes, etcdNodes[0].String()) fmt.Println(cmd) if _, err := e2e.RunCommand(cmd); err != nil { return etcdNodes, cpNodes, agentNodes, err @@ -72,7 +72,7 @@ func createSplitCluster(nodeOS string, etcdCount, controlPlaneCount, agentCount // Bring up the rest of the nodes in parallel errg, _ := errgroup.WithContext(context.Background()) for _, node := range allNodeNames[1:] { - cmd := fmt.Sprintf(`E2E_NODE_ROLES="%s" E2E_NODE_BOXES="%s" vagrant up --no-provision %s &>> vagrant.log`, nodeRoles, nodeBoxes, node) + cmd := fmt.Sprintf(`E2E_NODE_ROLES="%s" E2E_NODE_BOXES="%s" vagrant up --no-tty --no-provision %s &>> vagrant.log`, nodeRoles, nodeBoxes, node) errg.Go(func() error { _, err := e2e.RunCommand(cmd) return err diff --git a/tests/e2e/testutils.go b/tests/e2e/testutils.go index be26dad021..ea98742d7a 100644 --- a/tests/e2e/testutils.go +++ b/tests/e2e/testutils.go @@ -133,7 +133,7 @@ func CreateCluster(nodeOS string, serverCount, agentCount int) (*TestConfig, err } } // Bring up the first server node - cmd := fmt.Sprintf(`%s %s vagrant up %s &> vagrant.log`, nodeEnvs, testOptions, serverNodes[0]) + cmd := fmt.Sprintf(`%s %s vagrant up --no-tty %s &> vagrant.log`, nodeEnvs, testOptions, serverNodes[0]) fmt.Println(cmd) if _, err := RunCommand(cmd); err != nil { return nil, newNodeError(cmd, serverNodes[0], err) @@ -142,7 +142,7 @@ func CreateCluster(nodeOS string, serverCount, agentCount int) (*TestConfig, err // Bring up the rest of the nodes in parallel errg, _ := errgroup.WithContext(context.Background()) for _, node := range append(serverNodes[1:], agentNodes...) { - cmd := fmt.Sprintf(`%s %s vagrant up %s &>> vagrant.log`, nodeEnvs, testOptions, node.String()) + cmd := fmt.Sprintf(`%s %s vagrant up --no-tty %s &>> vagrant.log`, nodeEnvs, testOptions, node.String()) fmt.Println(cmd) errg.Go(func() error { if _, err := RunCommand(cmd); err != nil { @@ -224,7 +224,7 @@ func CreateLocalCluster(nodeOS string, serverCount, agentCount int) (*TestConfig // Bring up the rest of the nodes in parallel errg, _ := errgroup.WithContext(context.Background()) for _, node := range append(serverNodes[1:], agentNodes...) { - cmd := fmt.Sprintf(`%s %s vagrant up --no-provision %s &>> vagrant.log`, nodeEnvs, testOptions, node) + cmd := fmt.Sprintf(`%s %s vagrant up --no-tty --no-provision %s &>> vagrant.log`, nodeEnvs, testOptions, node) errg.Go(func() error { if _, err := RunCommand(cmd); err != nil { return newNodeError(cmd, node, err)