Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
britaniar committed Apr 9, 2024
1 parent 649696e commit 7a00a04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/e2e/placement_selecting_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ package e2e

import (
"fmt"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/utils/ptr"
"strconv"
"time"

"github.com/google/go-cmp/cmp"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

placementv1beta1 "go.goms.io/fleet/apis/placement/v1beta1"
Expand Down Expand Up @@ -764,10 +764,12 @@ var _ = Describe("validating CRP when selecting a reserved resource", Ordered, f

var _ = Describe("validating CRP when failed to apply resources", Ordered, func() {
crpName := fmt.Sprintf(crpNameTemplate, GinkgoParallelProcess())
workNamespaceName := fmt.Sprintf(workNamespaceNameTemplate, GinkgoParallelProcess())

BeforeAll(func() {
By("creating work resources on hub cluster")
createWorkResources()
Expect(hubClient.Get(ctx, types.NamespacedName{Name: workNamespaceName}, &corev1.Namespace{})).Should(Succeed(), "Failed to get the namespace %s", workNamespaceName)

By("creating work namespace on member cluster")
ns := appNamespace()
Expand Down Expand Up @@ -808,7 +810,6 @@ var _ = Describe("validating CRP when failed to apply resources", Ordered, func(
return err
}

workNamespaceName := fmt.Sprintf(workNamespaceNameTemplate, GinkgoParallelProcess())
appConfigMapName := fmt.Sprintf(appConfigMapNameTemplate, GinkgoParallelProcess())
wantStatus := placementv1beta1.ClusterResourcePlacementStatus{
Conditions: []metav1.Condition{
Expand Down
1 change: 1 addition & 0 deletions test/e2e/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ func createWorkResource(name, namespace string) {
// createWorkResources creates some resources on the hub cluster for testing purposes.
func createWorkResources() {
ns := appNamespace()
By(fmt.Sprintf("Creating namespace: %s", ns.Name))
Expect(hubClient.Create(ctx, &ns)).To(Succeed(), "Failed to create namespace %s", ns.Namespace)

configMap := appConfigMap()
Expand Down

0 comments on commit 7a00a04

Please sign in to comment.