Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
croomes committed Jan 19, 2021
1 parent 2bfb5cf commit 3eebcb1
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions test/e2e/clusterCSINodeV2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package e2e

import (
"context"
"strings"
"testing"

framework "github.com/operator-framework/operator-sdk/pkg/test"
Expand Down Expand Up @@ -78,23 +77,10 @@ func TestClusterCSINodeV2(t *testing.T) {
t.Fatalf("failed to get storageos-daemonset: %v", err)
}

info, err := f.KubeClient.Discovery().ServerVersion()
if err != nil {
t.Fatalf("failed to get version info: %v", err)
}

version := strings.TrimLeft(info.String(), "v")

//Check the number of containers in daemonset pod spec.
t.Run("CSIHelperCountTest", func(t *testing.T) {
//Check the number of containers in daemonset pod spec.
if deploy.CSIV1Supported(version) {
if len(daemonset.Spec.Template.Spec.Containers) != 3 {
t.Errorf("unexpected number of daemonset pod containers:\n\t(GOT) %d\n\t(WNT) %d", len(daemonset.Spec.Template.Spec.Containers), 3)
}
} else {
if len(daemonset.Spec.Template.Spec.Containers) != 2 {
t.Errorf("unexpected number of daemonset pod containers:\n\t(GOT) %d\n\t(WNT) %d", len(daemonset.Spec.Template.Spec.Containers), 2)
}
if len(daemonset.Spec.Template.Spec.Containers) != 3 {
t.Errorf("unexpected number of daemonset pod containers:\n\t(GOT) %d\n\t(WNT) %d", len(daemonset.Spec.Template.Spec.Containers), 3)
}
})

Expand Down

0 comments on commit 3eebcb1

Please sign in to comment.