Skip to content

Commit

Permalink
🐛 Fix test for number of gc CronJobs (#941)
Browse files Browse the repository at this point in the history
The test worked accidentally with single node clusters, but failed with two node clusters, e.g., EKS.

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker authored Nov 17, 2023
1 parent 441e27c commit f7e332d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/audit_config_base_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,14 @@ func (s *AuditConfigBaseSuite) testMondooAuditConfigNodes(auditConfig mondoov2.M
// Verify the amount of CronJobs created is 1
err = s.testCluster.K8sHelper.ExecuteWithRetries(func() (bool, error) {
s.NoError(s.testCluster.K8sHelper.Clientset.List(s.ctx, gcCronJobs, gcListOpts))
if len(cronJobs.Items) == 1 {
if len(gcCronJobs.Items) == 1 {
return true, nil
}
return false, nil
})
s.NoErrorf(
err,
"The amount of garbage collect CronJobs is not 1 expected: 1; actual: %d", len(cronJobs.Items))
"The amount of garbage collect CronJobs is not 1 expected: 1; actual: %d", len(gcCronJobs.Items))

err = s.testCluster.K8sHelper.CheckForReconciledOperatorVersion(&auditConfig, version.Version)
s.NoErrorf(err, "Couldn't find expected version in MondooAuditConfig.Status.ReconciledByOperatorVersion")
Expand Down

0 comments on commit f7e332d

Please sign in to comment.