Skip to content

Commit

Permalink
use different CRS for each test
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Jan 15, 2021
1 parent 0ddd914 commit 72a5865
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions exp/addons/controllers/clusterresourceset_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ const (

var _ = Describe("ClusterResourceSet Reconciler", func() {

var clusterResourceSetName string

var testCluster *clusterv1.Cluster
var clusterName string

var configmapName = "test-configmap"
var configmap2Name = "test-configmap2"

BeforeEach(func() {
clusterResourceSetName = fmt.Sprintf("clusterresourceset-%s", util.RandomString(6))

clusterName = fmt.Sprintf("cluster-%s", util.RandomString(6))
testCluster = &clusterv1.Cluster{ObjectMeta: metav1.ObjectMeta{Name: clusterName, Namespace: defaultNamespaceName}}

Expand Down Expand Up @@ -99,7 +103,7 @@ metadata:

clusterResourceSetInstance := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
},
}
Expand Down Expand Up @@ -129,7 +133,7 @@ metadata:
By("Creating a ClusterResourceSet instance that has same labels as selector")
clusterResourceSetInstance := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
},
Spec: addonsv1.ClusterResourceSetSpec{
Expand Down Expand Up @@ -181,7 +185,7 @@ metadata:

clusterResourceSetInstance := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
},
Spec: addonsv1.ClusterResourceSetSpec{
Expand Down Expand Up @@ -243,7 +247,7 @@ metadata:

clusterResourceSetInstance := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
},
Spec: addonsv1.ClusterResourceSetSpec{
Expand Down Expand Up @@ -317,7 +321,7 @@ metadata:
By("Creating a ClusterResourceSet instance that has same labels as selector")
clusterResourceSetInstance2 := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
},
Spec: addonsv1.ClusterResourceSetSpec{
Expand Down Expand Up @@ -396,7 +400,7 @@ metadata:
labels := map[string]string{"foo": "bar"}
clusterResourceSetInstance := &addonsv1.ClusterResourceSet{
ObjectMeta: metav1.ObjectMeta{
Name: "test-clusterresourceset",
Name: clusterResourceSetName,
Namespace: defaultNamespaceName,
Finalizers: []string{addonsv1.ClusterResourceSetFinalizer},
DeletionTimestamp: &dt,
Expand Down

0 comments on commit 72a5865

Please sign in to comment.