@@ -37,6 +37,9 @@ var _ = Describe("Notebook controller", func() {
37
37
Namespace = "default"
38
38
timeout = time .Second * 10
39
39
interval = time .Millisecond * 250
40
+
41
+ testLabelName = "testLabel"
42
+ testLabelValue = "testLabelValue"
40
43
)
41
44
42
45
Context ("When validating the notebook controller" , func () {
@@ -47,6 +50,9 @@ var _ = Describe("Notebook controller", func() {
47
50
ObjectMeta : metav1.ObjectMeta {
48
51
Name : Name ,
49
52
Namespace : Namespace ,
53
+ Labels : map [string ]string {
54
+ testLabelName : testLabelValue ,
55
+ },
50
56
},
51
57
Spec : nbv1beta1.NotebookSpec {
52
58
Template : nbv1beta1.NotebookTemplateSpec {
@@ -62,10 +68,7 @@ var _ = Describe("Notebook controller", func() {
62
68
63
69
Eventually (func () bool {
64
70
err := k8sClient .Get (ctx , notebookLookupKey , createdNotebook )
65
- if err != nil {
66
- return false
67
- }
68
- return true
71
+ return err == nil
69
72
}, timeout , interval ).Should (BeTrue ())
70
73
/*
71
74
Checking for the underlying statefulset.
@@ -82,6 +85,10 @@ var _ = Describe("Notebook controller", func() {
82
85
if err != nil {
83
86
return false , err
84
87
}
88
+
89
+ By ("By checking that the StatefulSet has identical Labels as the Notebook" )
90
+ Expect (sts .GetLabels ()).To (Equal (notebook .GetLabels ()))
91
+
85
92
return true , nil
86
93
}, timeout , interval ).Should (BeTrue ())
87
94
})
0 commit comments