diff --git a/e2e/common/fixtures/fixtures.go b/e2e/common/fixtures/fixtures.go index a3e77e64..87e62650 100644 --- a/e2e/common/fixtures/fixtures.go +++ b/e2e/common/fixtures/fixtures.go @@ -23,7 +23,6 @@ const ( FileStorageSize = "1Gi" MemStorageSize = "1Gi" True = "true" - PriorityClassName = "nats-manager-priority-class" ) func NATSCR() *natsv1alpha1.NATS { diff --git a/e2e/setup/setup_test.go b/e2e/setup/setup_test.go index c3313a49..cba26794 100644 --- a/e2e/setup/setup_test.go +++ b/e2e/setup/setup_test.go @@ -128,6 +128,8 @@ func Test_CR(t *testing.T) { ) } +// Test_PriorityClass will get the PriorityClass name from the StatefulSet and checks if a PriorityClass with that +// name exists in the cluster. func Test_PriorityClass(t *testing.T) { ctx := context.TODO() @@ -139,10 +141,10 @@ func Test_PriorityClass(t *testing.T) { pcName := sts.Spec.Template.Spec.PriorityClassName if len(pcName) < 1 { - return fmt.Errorf(".spec.priorityClassName of sts %s is not supposed to be empty", sts.Name) + return nil } - _, pcErr := clientSet.SchedulingV1().PriorityClasses().Get(ctx, PriorityClassName, metav1.GetOptions{}) + _, pcErr := clientSet.SchedulingV1().PriorityClasses().Get(ctx, pcName, metav1.GetOptions{}) return pcErr })