@@ -20,11 +20,12 @@ import (
2020 "time"
2121
2222 "github.com/checkly/checkly-go-sdk"
23- checklyv1alpha1 "github.com/checkly/checkly-operator/api/checkly/v1alpha1"
2423 . "github.com/onsi/ginkgo"
2524 . "github.com/onsi/gomega"
2625 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2726 "k8s.io/apimachinery/pkg/types"
27+
28+ checklyv1alpha1 "github.com/checkly/checkly-operator/api/checkly/v1alpha1"
2829)
2930
3031var _ = Describe ("ApiCheck Controller" , func () {
@@ -51,6 +52,7 @@ var _ = Describe("ApiCheck Controller", func() {
5152 It ("Full reconciliation" , func () {
5253
5354 updatedLocations := []string {"eu-west-2" , "eu-west-1" }
55+ updatedPrivateLocations := []string {"ground-floor" }
5456 groupKey := types.NamespacedName {
5557 Name : "test-group" ,
5658 }
@@ -64,8 +66,9 @@ var _ = Describe("ApiCheck Controller", func() {
6466 Name : groupKey .Name ,
6567 },
6668 Spec : checklyv1alpha1.GroupSpec {
67- Locations : []string {"eu-west-1" },
68- AlertChannels : []string {alertChannelKey .Name },
69+ Locations : []string {"eu-west-1" },
70+ PrivateLocations : []string {},
71+ AlertChannels : []string {alertChannelKey .Name },
6972 },
7073 }
7174
@@ -140,6 +143,20 @@ var _ = Describe("ApiCheck Controller", func() {
140143 }
141144 }, timeout , interval ).Should (BeTrue ())
142145
146+ updated .Spec .PrivateLocations = updatedPrivateLocations
147+ Expect (k8sClient .Update (context .Background (), updated )).Should (Succeed ())
148+
149+ By ("Expecting update" )
150+ Eventually (func () bool {
151+ f := & checklyv1alpha1.Group {}
152+ err := k8sClient .Get (context .Background (), groupKey , f )
153+ if len (f .Spec .PrivateLocations ) == 1 && err == nil {
154+ return true
155+ } else {
156+ return false
157+ }
158+ }, timeout , interval ).Should (BeTrue ())
159+
143160 // Delete group
144161 By ("Expecting to delete successfully" )
145162 Eventually (func () error {
0 commit comments