Skip to content

Commit

Permalink
remove some checks in log messages, they're redundant, and the format…
Browse files Browse the repository at this point in the history
… has changed

Signed-off-by: Michael Henriksen <mhenriks@redhat.com>
  • Loading branch information
mhenriks committed Apr 12, 2023
1 parent fa2fe1a commit 049cf63
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
8 changes: 0 additions & 8 deletions tests/cloner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2221,14 +2221,6 @@ var _ = Describe("all clone tests", func() {

f.ForceBindPvcIfDvIsWaitForFirstConsumer(dataVolume)

By("Verify Quota was exceeded in logs")
matchString := strings.Trim(fmt.Sprintf("\"namespace\": \"%s\", \"error\": \"pods \\\"cdi-upload-target-dv\\\" is forbidden: exceeded quota: test-quota, requested", targetNs.Name), " ")
Eventually(func() string {
log, err := f.RunKubectlCommand("logs", f.ControllerPod.Name, "-n", f.CdiInstallNs)
Expect(err).NotTo(HaveOccurred())
return strings.Trim(log, " ")
}, controllerSkipPVCCompleteTimeout, assertionPollInterval).Should(ContainSubstring(matchString))

expectedCondition := &cdiv1.DataVolumeCondition{
Type: cdiv1.DataVolumeRunning,
Status: v1.ConditionFalse,
Expand Down
16 changes: 0 additions & 16 deletions tests/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,14 +800,6 @@ var _ = Describe("Namespace with quota", func() {
pvcAnn,
nil))

By("Verify Quota was exceeded in logs")
matchString := strings.Trim(fmt.Sprintf(`"name": "import-image-to-pvc", "namespace": "%s", "error": "pods \"importer-import-image-to-pvc\" is forbidden: exceeded quota: test-quota`, f.Namespace.Name), " ")
Eventually(func() string {
log, err := f.RunKubectlCommand("logs", f.ControllerPod.Name, "-n", f.CdiInstallNs)
Expect(err).NotTo(HaveOccurred())
return strings.Trim(log, " ")
}, controllerSkipPVCCompleteTimeout, assertionPollInterval).Should(ContainSubstring(matchString))

By("Check the expected event")
msg := fmt.Sprintf(controller.MessageErrStartingPod, "importer-import-image-to-pvc")
f.ExpectEvent(f.Namespace.Name).Should(ContainSubstring(msg))
Expand All @@ -832,14 +824,6 @@ var _ = Describe("Namespace with quota", func() {
pvcAnn,
nil))

By("Verify Quota was exceeded in logs")
matchString := strings.Trim(fmt.Sprintf(`"name": "import-image-to-pvc", "namespace": "%s", "error": "pods \"importer-import-image-to-pvc\" is forbidden: exceeded quota: test-quota`, f.Namespace.Name), " ")
Eventually(func() string {
log, err := f.RunKubectlCommand("logs", f.ControllerPod.Name, "-n", f.CdiInstallNs)
Expect(err).NotTo(HaveOccurred())
return strings.Trim(log, " ")
}, controllerSkipPVCCompleteTimeout, assertionPollInterval).Should(ContainSubstring(matchString))

By("Check the expected event")
msg := fmt.Sprintf(controller.MessageErrStartingPod, "importer-import-image-to-pvc")
f.ExpectEvent(f.Namespace.Name).Should(ContainSubstring(msg))
Expand Down

0 comments on commit 049cf63

Please sign in to comment.