Skip to content

Commit af2d995

Browse files
committed
Extend simple test for Notebook -> StatefulSet labels propagation.
1 parent 348f944 commit af2d995

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

components/notebook-controller/controllers/notebook_controller_bdd_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ var _ = Describe("Notebook controller", func() {
3737
Namespace = "default"
3838
timeout = time.Second * 10
3939
interval = time.Millisecond * 250
40+
41+
testLabelName = "testLabel"
42+
testLabelValue = "testLabelValue"
4043
)
4144

4245
Context("When validating the notebook controller", func() {
@@ -47,6 +50,9 @@ var _ = Describe("Notebook controller", func() {
4750
ObjectMeta: metav1.ObjectMeta{
4851
Name: Name,
4952
Namespace: Namespace,
53+
Labels: map[string]string{
54+
testLabelName: testLabelValue,
55+
},
5056
},
5157
Spec: nbv1beta1.NotebookSpec{
5258
Template: nbv1beta1.NotebookTemplateSpec{
@@ -62,10 +68,7 @@ var _ = Describe("Notebook controller", func() {
6268

6369
Eventually(func() bool {
6470
err := k8sClient.Get(ctx, notebookLookupKey, createdNotebook)
65-
if err != nil {
66-
return false
67-
}
68-
return true
71+
return err == nil
6972
}, timeout, interval).Should(BeTrue())
7073
/*
7174
Checking for the underlying statefulset.
@@ -82,6 +85,10 @@ var _ = Describe("Notebook controller", func() {
8285
if err != nil {
8386
return false, err
8487
}
88+
89+
By("By checking that the StatefulSet has identical Labels as the Notebook")
90+
Expect(sts.GetLabels()).To(Equal(notebook.GetLabels()))
91+
8592
return true, nil
8693
}, timeout, interval).Should(BeTrue())
8794
})

0 commit comments

Comments
 (0)