forked from openshift-knative/serverless-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SRVKE-1193] Remove sugar resources (openshift-knative#1669)
* [SRVKE-1193] Remove sugar resources - Remove deployment - Remove service for monitoring - Remove service monitor Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Add e2e test Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Convert dashboard unit test to E2E test Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Lint Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> * Fix linter error Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
- Loading branch information
Showing
8 changed files
with
144 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package e2e | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
"time" | ||
|
||
apierrors "k8s.io/apimachinery/pkg/api/errors" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/util/wait" | ||
|
||
"github.com/openshift-knative/serverless-operator/test" | ||
) | ||
|
||
var ( | ||
EventingDashboards = []string{ | ||
"grafana-dashboard-definition-knative-eventing-resources", | ||
"grafana-dashboard-definition-knative-eventing-broker", | ||
"grafana-dashboard-definition-knative-eventing-kafka-broker", | ||
"grafana-dashboard-definition-knative-eventing-source", | ||
"grafana-dashboard-definition-knative-eventing-channel", | ||
"grafana-dashboard-definition-knative-eventing-kafka-sink", | ||
} | ||
) | ||
|
||
func VerifyDashboards(t *testing.T, caCtx *test.Context, dashboards []string) { | ||
t.Run("Verify dashboards", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
ns := "openshift-config-managed" | ||
ctx := context.Background() | ||
|
||
for _, d := range dashboards { | ||
t.Run(d, func(t *testing.T) { | ||
err := wait.PollImmediate(time.Second, time.Minute, func() (bool, error) { | ||
_, err := caCtx.Clients.Kube.CoreV1().ConfigMaps(ns).Get(ctx, d, metav1.GetOptions{}) | ||
if err != nil && !apierrors.IsNotFound(err) { | ||
return false, err | ||
} | ||
if apierrors.IsNotFound(err) { | ||
return false, nil | ||
} | ||
return true, nil | ||
}) | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
}) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package upgrade | ||
|
||
import ( | ||
"knative.dev/pkg/test/upgrade" | ||
|
||
"github.com/openshift-knative/serverless-operator/test" | ||
) | ||
|
||
func VerifySugarControllerDeletion(ctx *test.Context) upgrade.Operation { | ||
return upgrade.NewOperation("Verify sugar-controller deletion", func(c upgrade.Context) { | ||
if err := test.CheckNoDeployment(ctx.Clients.Kube, "knative-eventing", "sugar-controller"); err != nil { | ||
c.T.Error(err) | ||
} | ||
}) | ||
} |