Skip to content

Commit

Permalink
Address comments v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrahman-suse committed Feb 5, 2025
1 parent a0c1ae6 commit e698756
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
18 changes: 7 additions & 11 deletions pkg/testcase/daemonset.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package testcase

import (
"fmt"
"sort"
"strings"

Expand All @@ -19,14 +18,15 @@ func TestDaemonset(applyWorkload, deleteWorkload bool) {
Expect(workloadErr).NotTo(HaveOccurred(), "Daemonset manifest not deployed")
}

getDeamonset := "kubectl get pods -n test-daemonset" +
" --field-selector=status.phase=Running --kubeconfig="
err := assert.ValidateOnHost(getDeamonset+shared.KubeConfigFile, statusRunning)
cmd := "kubectl get pods -n test-daemonset" +
" --field-selector=status.phase=Running " +
" --kubeconfig=" + shared.KubeConfigFile
err := assert.ValidateOnHost(cmd, statusRunning)
Expect(err).NotTo(HaveOccurred(), err)

pods, _ := shared.GetPods(false)

cmd := "kubectl get pods -n test-daemonset" +
cmd = "kubectl get pods -n test-daemonset" +
` -o jsonpath='{range .items[*]}{.spec.nodeName}{"\n"}{end}'` +
" --kubeconfig=" + shared.KubeConfigFile

Expand All @@ -43,12 +43,8 @@ func TestDaemonset(applyWorkload, deleteWorkload bool) {
}
}

cmd = fmt.Sprintf(`
kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints \
--kubeconfig="%s" | grep '<none>'
`,
shared.KubeConfigFile,
)
cmd = "kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints" +
" --kubeconfig=" + shared.KubeConfigFile + ` | grep '<none>'`
taints, err := shared.RunCommandHost(cmd)
if err != nil {
return
Expand Down
5 changes: 1 addition & 4 deletions pkg/testcase/upgrademanual.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package testcase
import (
"errors"
"fmt"
"time"

"github.com/rancher/distros-test-framework/pkg/k8s"
"github.com/rancher/distros-test-framework/shared"
Expand Down Expand Up @@ -72,12 +71,10 @@ func upgradeProduct(product, nodeType, installType, ip string) error {

actions := []shared.ServiceAction{
{Service: product, Action: restart, NodeType: nodeType, ExplicitDelay: 180},
{Service: product, Action: status, NodeType: nodeType, ExplicitDelay: 60},
{Service: product, Action: status, NodeType: nodeType, ExplicitDelay: 30},
}

if product == "rke2" {
shared.LogLevel("info", "Waiting for 2 mins after installing upgrade...")
time.Sleep(2 * time.Minute)
ms := shared.NewManageService(3, 30)
output, err := ms.ManageService(ip, actions)
if output != "" {
Expand Down

0 comments on commit e698756

Please sign in to comment.