File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 66 . "github.com/onsi/gomega"
77 mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
88
9+ "k8s.io/apimachinery/pkg/api/errors"
10+
911 . "github.com/project-codeflare/codeflare-operator/test/support"
1012)
1113
@@ -14,7 +16,8 @@ func TestInstascaleMachineSet(t *testing.T) {
1416 test .T ().Parallel ()
1517
1618 // skip test if not using machine sets
17- if ! MachineSetsExist (test ) {
19+ ms , err := MachineSetsExist (test )
20+ if ! ms || err != nil && errors .IsNotFound (err ) {
1821 test .T ().Skip ("Skipping test as machine sets don't exist" )
1922 }
2023
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package support
33import (
44 "github.com/onsi/gomega"
55
6+ "k8s.io/apimachinery/pkg/api/errors"
67 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
78
89 v1beta1 "github.com/openshift/api/machine/v1beta1"
@@ -29,8 +30,11 @@ func MachineSetId(machineSet v1beta1.MachineSet) string {
2930 return machineSet .Name
3031}
3132
32- func MachineSetsExist (t Test ) bool {
33+ func MachineSetsExist (t Test ) ( bool , error ) {
3334 ms , err := MachineSets (t )
35+ if err != nil && errors .IsNotFound (err ) {
36+ return false , err
37+ }
3438 t .Expect (err ).NotTo (gomega .HaveOccurred ())
35- return ms != nil
39+ return ms != nil , err
3640}
You can’t perform that action at this time.
0 commit comments