diff --git a/e2e/global_test.go b/e2e/global_test.go index 7d785af376..dc4062b9f3 100644 --- a/e2e/global_test.go +++ b/e2e/global_test.go @@ -22,14 +22,27 @@ limitations under the License. package e2e import ( + "os" "testing" "time" + "github.com/apache/camel-k/pkg/util/openshift" . "github.com/onsi/gomega" + "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" ) func TestRunGlobalInstall(t *testing.T) { + forceGlobalTest := os.Getenv("CAMEL_K_FORCE_GLOBAL_TEST") == "true" + if !forceGlobalTest { + ocp, err := openshift.IsOpenShift(testClient) + assert.Nil(t, err) + if ocp { + t.Skip("Prefer not to run on OpenShift to avoid giving more permissions to the user running tests") + return + } + } + withNewTestNamespace(t, func(ns string) { Expect(kamel("install", "-n", ns, "--global").Execute()).Should(BeNil()) diff --git a/e2e/util/dump.go b/e2e/util/dump.go index f5ae69c49d..c8454e19d4 100644 --- a/e2e/util/dump.go +++ b/e2e/util/dump.go @@ -62,7 +62,10 @@ func Dump(c client.Client, ns string, t *testing.T) error { t.Logf("name=%s\n", pod.Name) dumpConditions(" ", pod.Status.Conditions, t) t.Logf(" logs:\n") - for _, container := range pod.Spec.Containers { + var allContainers []v1.Container + allContainers = append(allContainers, pod.Spec.InitContainers...) + allContainers = append(allContainers, pod.Spec.Containers...) + for _, container := range allContainers { pad := " " t.Logf("%s%s\n", pad, container.Name) err := dumpLogs(c, fmt.Sprintf("%s> ", pad), ns, pod.Name, container.Name, t)