Skip to content

Commit

Permalink
Log ARO operator on MUO e2e test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
tsatam committed Oct 1, 2024
1 parent 0166b4d commit 0d281de
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/e2e/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,24 @@ var _ = Describe("ARO Operator - MUO Deployment", Focus, MustPassRepeatedly(10),

JustAfterEach(func(ctx context.Context) {
if CurrentSpecReport().Failed() {
getOperatorFunc := clients.ConfigClient.ConfigV1().ClusterOperators().Get
operator := GetK8sObjectWithRetry(ctx, getOperatorFunc, "aro", metav1.GetOptions{})

AddReportEntry("aro-operator", operator)

aroOperatorMasterPods := ListK8sObjectWithRetry(
ctx,
clients.Kubernetes.CoreV1().Pods(aroOperatorNamespace).List,
metav1.ListOptions{LabelSelector: "app=aro-operator-master"},
)
Expect(aroOperatorMasterPods.Items).NotTo(BeEmpty())

logs := GetK8sPodLogsWithRetry(
ctx, aroOperatorNamespace, aroOperatorMasterPods.Items[0].Name, corev1.PodLogOptions{},
)

AddReportEntry("aro-operator-logs", logs)

deployment, err := clients.Kubernetes.AppsV1().
Deployments(managedUpgradeOperatorDeployment).
Get(ctx, managedUpgradeOperatorDeployment, metav1.GetOptions{})
Expand Down

0 comments on commit 0d281de

Please sign in to comment.