Skip to content

Commit e7f85dc

Browse files
kuiwang02ci-robot
authored andcommitted
UPSTREAM: <carry>: fix cases 81696 and 74618 for product code changes
1 parent 2f5aa3a commit e7f85dc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

openshift/tests-extension/test/qe/specs/olmv1_ce.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,15 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
787787
o.Expect(err).NotTo(o.HaveOccurred())
788788

789789
g.By("create role for ns watch")
790-
defer func() { _ = oc.AsAdmin().WithoutNamespace().Run("delete").Args("-f", roleNsWatchFile).Execute() }()
791-
err = oc.AsAdmin().WithoutNamespace().Run("apply").Args("-f", roleNsWatchFile).Execute()
792-
o.Expect(err).NotTo(o.HaveOccurred())
790+
// Check if the watch namespace role file exists before trying to apply it
791+
// The file may not exist if no permissions are needed for the watch namespace
792+
if _, err := os.Stat(roleNsWatchFile); err == nil {
793+
defer func() { _ = oc.AsAdmin().WithoutNamespace().Run("delete").Args("-f", roleNsWatchFile).Execute() }()
794+
err = oc.AsAdmin().WithoutNamespace().Run("apply").Args("-f", roleNsWatchFile).Execute()
795+
o.Expect(err).NotTo(o.HaveOccurred())
796+
} else {
797+
e2e.Logf("Watch namespace role file %s does not exist, skipping creation", roleNsWatchFile)
798+
}
793799

794800
g.By("create binding")
795801
paremeters = []string{"-n", "default", "--ignore-unknown-parameters=true", "-f", bindingTemplate, "-p",
@@ -918,7 +924,7 @@ var _ = g.Describe("[sig-olmv1][Jira:OLM] clusterextension", g.Label("NonHyperSh
918924
g.By("check non all ns mode fails to be installed.")
919925
defer ceNAN.Delete(oc)
920926
_ = ceNAN.CreateWithoutCheck(oc)
921-
ceNAN.CheckClusterExtensionCondition(oc, "Progressing", "message", "do not support targeting all namespaces", 10, 180, 0)
927+
ceNAN.CheckClusterExtensionCondition(oc, "Progressing", "message", "bundle does not support AllNamespaces install mode", 10, 180, 0)
922928
ceNAN.CheckClusterExtensionCondition(oc, "Installed", "reason", "Failed", 10, 180, 0)
923929
ceNAN.Delete(oc)
924930
}

0 commit comments

Comments
 (0)