Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: address malformed CMO configmap post-test #29309

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions test/extended/prometheus/collection_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfil
if err != nil {
if errors.IsNotFound(err) {
g.By("initially, creating a configuration for the operator as it did not exist")
operatorConfiguration = nil
err = r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the 2 other suggestions, I find the code flow to be easier to read.

Suggested change
err = r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault)
return r.makeCollectionProfileConfigurationFor(tctx, collectionProfileDefault)

}
rexagod marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
}

return nil
return err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return err
return nil

}).Should(o.BeNil())
r.originalOperatorConfiguration = operatorConfiguration
})
Expand All @@ -108,6 +106,14 @@ var _ = g.Describe("[sig-instrumentation][OCPFeatureGate:MetricsCollectionProfil
err = r.kclient.CoreV1().ConfigMaps(operatorNamespaceName).Delete(tctx, operatorConfigurationName, metav1.DeleteOptions{})
}
o.Expect(err).To(o.BeNil())

o.Eventually(func() error {
_, err := r.kclient.CoreV1().ConfigMaps(operatorNamespaceName).Get(tctx, operatorConfigurationName, metav1.GetOptions{})
if errors.IsNotFound(err) {
return nil
}
return fmt.Errorf("ConfigMap %q still exists after deletion attempt", operatorConfigurationName)
}).Should(o.BeNil())
})

g.Context("initially, in a homogeneous default environment,", func() {
Expand Down