Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-pius committed Jan 3, 2025
1 parent 2639484 commit 6337b4a
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/e2e/labelling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package e2e_test

import (
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
apiappsv1 "k8s.io/api/apps/v1"
apicorev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"

Expand All @@ -16,12 +16,12 @@ import (
)

var managedSkrResources = map[types.NamespacedName]schema.GroupVersionKind{
{Name: "kyma-sample", Namespace: RemoteNamespace}: v1beta2.GroupVersion.WithKind("Kyma"),
{Name: "skr-webhook", Namespace: RemoteNamespace}: appsv1.SchemeGroupVersion.WithKind("Deployment"),
{Name: "default", Namespace: RemoteNamespace}: v1beta2.GroupVersion.WithKind("Kyma"),
{Name: "skr-webhook", Namespace: RemoteNamespace}: apiappsv1.SchemeGroupVersion.WithKind("Deployment"),
{Name: "skr-webhook", Namespace: RemoteNamespace}: admissionregistrationv1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"),
{Name: "skr-webhook-tls", Namespace: RemoteNamespace}: corev1.SchemeGroupVersion.WithKind("Secret"),
{Name: "skr-webhook-sa", Namespace: RemoteNamespace}: corev1.SchemeGroupVersion.WithKind("ServiceAccount"),
{Name: RemoteNamespace, Namespace: ""}: corev1.SchemeGroupVersion.WithKind("Namespace"),
{Name: "skr-webhook-tls", Namespace: RemoteNamespace}: apicorev1.SchemeGroupVersion.WithKind("Secret"),
{Name: "skr-webhook-sa", Namespace: RemoteNamespace}: apicorev1.SchemeGroupVersion.WithKind("ServiceAccount"),
{Name: RemoteNamespace, Namespace: ""}: apicorev1.SchemeGroupVersion.WithKind("Namespace"),
}

var _ = Describe("Labelling SKR resources", Ordered, func() {
Expand All @@ -38,10 +38,11 @@ var _ = Describe("Labelling SKR resources", Ordered, func() {
WithContext(ctx).
WithArguments(
skrClient,
kyma.GetNamespacedName(),
kyma.GroupVersionKind(),
types.NamespacedName{Name: "default", Namespace: RemoteNamespace},
v1beta2.GroupVersion.WithKind("Kyma"),
shared.WatchedByLabel,
shared.WatchedByLabelValue)
shared.WatchedByLabelValue).
Should(Succeed())
By("And managed SKR resources are labelled with managed-by label")
for name, gvk := range managedSkrResources {
Eventually(HasExpectedLabel).
Expand All @@ -51,7 +52,8 @@ var _ = Describe("Labelling SKR resources", Ordered, func() {
name,
gvk,
shared.ManagedBy,
shared.ManagedByLabelValue)
shared.ManagedByLabelValue).
Should(Succeed())
}
})

Expand Down

0 comments on commit 6337b4a

Please sign in to comment.