@@ -126,8 +126,35 @@ var _ = Describe("ApiCheck Controller", func() {
126
126
}
127
127
}, timeout , interval ).Should (BeTrue ())
128
128
129
+ // Update
130
+ groupUpdateNS := "kube-system"
131
+ groupUpdate := & checklyv1alpha1.Group {
132
+ ObjectMeta : metav1.ObjectMeta {
133
+ Name : groupKey .Name ,
134
+ Namespace : groupUpdateNS ,
135
+ },
136
+ }
137
+ Expect (k8sClient .Create (context .Background (), groupUpdate )).Should (Succeed ())
138
+
139
+ apiCheckRaw := & checklyv1alpha1.ApiCheck {}
140
+ Expect (k8sClient .Get (context .Background (), key , apiCheckRaw )).Should (Succeed ())
141
+ apiCheckRaw .Spec .GroupNamespace = groupUpdateNS
142
+ Expect (k8sClient .Update (context .Background (), apiCheckRaw )).Should (Succeed ())
143
+
144
+ By ("Expecting groupnamespace to change" )
145
+ Eventually (func () bool {
146
+ f := & checklyv1alpha1.ApiCheck {}
147
+ err := k8sClient .Get (context .Background (), key , f )
148
+ if err == nil && f .Spec .GroupNamespace == groupUpdateNS {
149
+ return true
150
+ }
151
+ return false
152
+
153
+ }, timeout , interval ).Should (BeTrue ())
154
+
129
155
// Delete
130
156
Expect (k8sClient .Delete (context .Background (), group )).Should (Succeed ())
157
+ Expect (k8sClient .Delete (context .Background (), groupUpdate )).Should (Succeed ())
131
158
132
159
By ("Expecting to delete successfully" )
133
160
Eventually (func () error {
0 commit comments