File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 6
6
. "github.com/onsi/gomega"
7
7
mcadv1beta1 "github.com/project-codeflare/multi-cluster-app-dispatcher/pkg/apis/controller/v1beta1"
8
8
9
+ "k8s.io/apimachinery/pkg/api/errors"
10
+
9
11
. "github.com/project-codeflare/codeflare-operator/test/support"
10
12
)
11
13
@@ -14,7 +16,8 @@ func TestInstascaleMachineSet(t *testing.T) {
14
16
test .T ().Parallel ()
15
17
16
18
// skip test if not using machine sets
17
- if ! MachineSetsExist (test ) {
19
+ ms , err := MachineSetsExist (test )
20
+ if ! ms || err != nil && errors .IsNotFound (err ) {
18
21
test .T ().Skip ("Skipping test as machine sets don't exist" )
19
22
}
20
23
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package support
3
3
import (
4
4
"github.com/onsi/gomega"
5
5
6
+ "k8s.io/apimachinery/pkg/api/errors"
6
7
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
7
8
8
9
v1beta1 "github.com/openshift/api/machine/v1beta1"
@@ -29,8 +30,11 @@ func MachineSetId(machineSet v1beta1.MachineSet) string {
29
30
return machineSet .Name
30
31
}
31
32
32
- func MachineSetsExist (t Test ) bool {
33
+ func MachineSetsExist (t Test ) ( bool , error ) {
33
34
ms , err := MachineSets (t )
35
+ if err != nil && errors .IsNotFound (err ) {
36
+ return false , err
37
+ }
34
38
t .Expect (err ).NotTo (gomega .HaveOccurred ())
35
- return ms != nil
39
+ return ms != nil , err
36
40
}
You can’t perform that action at this time.
0 commit comments