@@ -20,15 +20,16 @@ import (
20
20
"github.com/onsi/gomega"
21
21
mcadv1beta2 "github.com/project-codeflare/appwrapper/api/v1beta2"
22
22
23
+ corev1 "k8s.io/api/core/v1"
23
24
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24
25
"k8s.io/apimachinery/pkg/runtime"
25
26
)
26
27
27
28
var appWrapperResource = mcadv1beta2 .GroupVersion .WithResource ("appwrappers" )
28
29
29
- func AppWrapper (t Test , namespace string , name string ) func (g gomega.Gomega ) * mcadv1beta2.AppWrapper {
30
+ func AppWrapper (t Test , namespace * corev1. Namespace , name string ) func (g gomega.Gomega ) * mcadv1beta2.AppWrapper {
30
31
return func (g gomega.Gomega ) * mcadv1beta2.AppWrapper {
31
- unstruct , err := t .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace ).Get (t .Ctx (), name , metav1.GetOptions {})
32
+ unstruct , err := t .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace . Name ).Get (t .Ctx (), name , metav1.GetOptions {})
32
33
g .Expect (err ).NotTo (gomega .HaveOccurred ())
33
34
aw := & mcadv1beta2.AppWrapper {}
34
35
err = runtime .DefaultUnstructuredConverter .FromUnstructured (unstruct .UnstructuredContent (), aw )
@@ -37,14 +38,14 @@ func AppWrapper(t Test, namespace string, name string) func(g gomega.Gomega) *mc
37
38
}
38
39
}
39
40
40
- func GetAppWrapper (t Test , namespace string , name string ) * mcadv1beta2.AppWrapper {
41
+ func GetAppWrapper (t Test , namespace * corev1. Namespace , name string ) * mcadv1beta2.AppWrapper {
41
42
t .T ().Helper ()
42
43
return AppWrapper (t , namespace , name )(t )
43
44
}
44
45
45
- func AppWrappers (t Test , namespace string ) func (g gomega.Gomega ) []* mcadv1beta2.AppWrapper {
46
+ func AppWrappers (t Test , namespace * corev1. Namespace ) func (g gomega.Gomega ) []* mcadv1beta2.AppWrapper {
46
47
return func (g gomega.Gomega ) []* mcadv1beta2.AppWrapper {
47
- aws , err := t .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace ).List (t .Ctx (), metav1.ListOptions {})
48
+ aws , err := t .Client ().Dynamic ().Resource (appWrapperResource ).Namespace (namespace . Name ).List (t .Ctx (), metav1.ListOptions {})
48
49
g .Expect (err ).NotTo (gomega .HaveOccurred ())
49
50
50
51
awsp := []* mcadv1beta2.AppWrapper {}
0 commit comments