@@ -44,7 +44,6 @@ import (
4444 "time"
4545
4646 consoleV1 "github.com/openshift/api/console/v1"
47- "github.com/stretchr/testify/require"
4847
4948 "github.com/google/uuid"
5049 "github.com/onsi/gomega"
@@ -78,7 +77,6 @@ import (
7877 traitv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1/trait"
7978 "github.com/apache/camel-k/v2/pkg/client"
8079 "github.com/apache/camel-k/v2/pkg/cmd"
81- "github.com/apache/camel-k/v2/pkg/install"
8280 "github.com/apache/camel-k/v2/pkg/platform"
8381 v2util "github.com/apache/camel-k/v2/pkg/util"
8482 "github.com/apache/camel-k/v2/pkg/util/defaults"
@@ -2557,50 +2555,6 @@ func ClusterDomainName(t *testing.T, ctx context.Context) (string, error) {
25572555 return dns .Spec .BaseDomain , nil
25582556}
25592557
2560- /*
2561- Tekton
2562- */
2563-
2564- func CreateOperatorServiceAccount (t * testing.T , ctx context.Context , ns string ) error {
2565- return install .Resource (ctx , TestClient (t ), ns , true , install .IdentityResourceCustomizer , "/config/manager/operator-service-account.yaml" )
2566- }
2567-
2568- func CreateOperatorRole (t * testing.T , ctx context.Context , ns string ) (err error ) {
2569- oc , err := openshift .IsOpenShift (TestClient (t ))
2570- if err != nil {
2571- failTest (t , err )
2572- }
2573- customizer := install .IdentityResourceCustomizer
2574- if oc {
2575- // Remove Ingress permissions as it's not needed on OpenShift
2576- // This should ideally be removed from the common RBAC manifest.
2577- customizer = install .RemoveIngressRoleCustomizer
2578- }
2579- err = install .Resource (ctx , TestClient (t ), ns , true , customizer , "/config/rbac/namespaced/operator-role.yaml" )
2580- if err != nil {
2581- return err
2582- }
2583- if oc {
2584- return install .Resource (ctx , TestClient (t ), ns , true , install .IdentityResourceCustomizer , "/config/rbac/openshift/namespaced/operator-role-openshift.yaml" )
2585- }
2586- return nil
2587- }
2588-
2589- func CreateOperatorRoleBinding (t * testing.T , ctx context.Context , ns string ) error {
2590- oc , err := openshift .IsOpenShift (TestClient (t ))
2591- if err != nil {
2592- failTest (t , err )
2593- }
2594- err = install .Resource (ctx , TestClient (t ), ns , true , install .IdentityResourceCustomizer , "/config/rbac/namespaced/operator-role-binding.yaml" )
2595- if err != nil {
2596- return err
2597- }
2598- if oc {
2599- return install .Resource (ctx , TestClient (t ), ns , true , install .IdentityResourceCustomizer , "/config/rbac/openshift/namespaced/operator-role-binding-openshift.yaml" )
2600- }
2601- return nil
2602- }
2603-
26042558// CreateKamelPodWithIntegrationSource generates and deploy a Pod from current Camel K controller image that will run a `kamel xxxx` command.
26052559// The integration parameter represent an Integration source file contained in a ConfigMap or Secret defined and mounted on the as a Volume.
26062560func CreateKamelPodWithIntegrationSource (t * testing.T , ctx context.Context , ns string , name string , integration v1.ValueSource , command ... string ) error {
@@ -2827,18 +2781,6 @@ func WithNewTestNamespace(t *testing.T, doRun func(context.Context, *gomega.With
28272781 invokeUserTestCode (t , testContext , ns .GetName (), doRun )
28282782}
28292783
2830- func WithGlobalOperatorNamespace (t * testing.T , test func (context.Context , * gomega.WithT , string )) {
2831- ocp , err := openshift .IsOpenShift (TestClient (t ))
2832- require .NoError (t , err )
2833- if ocp {
2834- // global operators are always installed in the openshift-operators namespace
2835- invokeUserTestCode (t , testContext , "openshift-operators" , test )
2836- } else {
2837- // create new namespace for the global operator
2838- WithNewTestNamespace (t , test )
2839- }
2840- }
2841-
28422784func WithNewTestNamespaceWithKnativeBroker (t * testing.T , doRun func (context.Context , * gomega.WithT , string )) {
28432785 ns := NewTestNamespace (t , testContext , true )
28442786 defer deleteTestNamespace (t , testContext , ns )
@@ -2867,6 +2809,8 @@ func userCleanup(t *testing.T) {
28672809func invokeUserTestCode (t * testing.T , ctx context.Context , ns string , doRun func (context.Context , * gomega.WithT , string )) {
28682810 defer func () {
28692811 DumpNamespace (t , ctx , ns )
2812+ // Also dump the operator namespace in case it's common
2813+ DumpNamespace (t , ctx , "camel-k" )
28702814 }()
28712815
28722816 g := gomega .NewWithT (t )
0 commit comments