Skip to content

Commit

Permalink
Fix MTQ (#2475)
Browse files Browse the repository at this point in the history
* improve MTQ e2e test stability

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

* Remove MTQ when the HyperConverged CR is removed

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>

---------

Signed-off-by: Nahshon Unna-Tsameret <nunnatsa@redhat.com>
  • Loading branch information
nunnatsa authored Aug 14, 2023
1 parent 998e0f9 commit ca87754
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions controllers/operands/operandHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func (h *OperandHandler) EnsureDeleted(req *common.HcoRequest) error {
NewNetworkAddonsWithNameOnly(req.Instance),
NewSSPWithNameOnly(req.Instance),
NewConsoleCLIDownload(req.Instance),
NewMTQWithNameOnly(req.Instance),
}

resources = append(resources, h.objects...)
Expand Down
11 changes: 8 additions & 3 deletions tests/func-tests/mtq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
conditionsv1 "github.com/openshift/custom-resource-status/conditions/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down Expand Up @@ -61,9 +62,13 @@ var _ = Describe("Test MTQ", Label("MTQ"), Serial, Ordered, func() {
}).WithTimeout(5 * time.Minute).WithPolling(time.Second).ShouldNot(BeTrue())

By("check MTQ pods")
pods, err := cli.CoreV1().Pods(flags.KubeVirtInstallNamespace).List(ctx, metav1.ListOptions{LabelSelector: "app.kubernetes.io/component=multi-tenant"})
Expect(err).ShouldNot(HaveOccurred())
Expect(pods.Items).Should(HaveLen(3))
Eventually(func(g Gomega) []corev1.Pod {
pods, err := cli.CoreV1().Pods(flags.KubeVirtInstallNamespace).List(ctx, metav1.ListOptions{LabelSelector: "app.kubernetes.io/component=multi-tenant"})
g.Expect(err).ShouldNot(HaveOccurred())
return pods.Items
}).WithTimeout(5 * time.Minute).
WithPolling(time.Second).
Should(HaveLen(3))
})
})
})
Expand Down

0 comments on commit ca87754

Please sign in to comment.