@@ -180,8 +180,21 @@ func checkResourcesInheritedAnnotations(cluster *Cluster, resultAnnotations map[
180180 return nil
181181 }
182182
183+ checkEndpoints := func (annotations map [string ]string ) error {
184+ endpointsList , err := cluster .KubeClient .Endpoints (namespace ).List (context .TODO (), clusterOptions )
185+ if err != nil {
186+ return err
187+ }
188+ for _ , ep := range endpointsList .Items {
189+ if err := containsAnnotations (annotations , ep .Annotations , ep .Name , "Endpoints" ); err != nil {
190+ return err
191+ }
192+ }
193+ return nil
194+ }
195+
183196 checkFuncs := []func (map [string ]string ) error {
184- checkSts , checkPods , checkSvc , checkPdb , checkPooler , checkPvc , checkSecrets ,
197+ checkSts , checkPods , checkSvc , checkPdb , checkPooler , checkPvc , checkSecrets , checkEndpoints ,
185198 }
186199 for _ , f := range checkFuncs {
187200 if err := f (resultAnnotations ); err != nil {
@@ -232,6 +245,7 @@ func newInheritedAnnotationsCluster(client k8sutil.KubernetesClient) (*Cluster,
232245 Volume : acidv1.Volume {
233246 Size : "1Gi" ,
234247 },
248+ NumberOfInstances : 2 ,
235249 },
236250 }
237251
@@ -260,6 +274,8 @@ func newInheritedAnnotationsCluster(client k8sutil.KubernetesClient) (*Cluster,
260274 PodRoleLabel : "spilo-role" ,
261275 ResourceCheckInterval : time .Duration (testResourceCheckInterval ),
262276 ResourceCheckTimeout : time .Duration (testResourceCheckTimeout ),
277+ MinInstances : - 1 ,
278+ MaxInstances : - 1 ,
263279 },
264280 },
265281 }, client , pg , logger , eventRecorder )
@@ -379,6 +395,17 @@ func annotateResources(cluster *Cluster) error {
379395 return err
380396 }
381397 }
398+
399+ endpoints , err := cluster .KubeClient .Endpoints (namespace ).List (context .TODO (), clusterOptions )
400+ if err != nil {
401+ return err
402+ }
403+ for _ , ep := range endpoints .Items {
404+ ep .Annotations = externalAnnotations
405+ if _ , err = cluster .KubeClient .Endpoints (namespace ).Update (context .TODO (), & ep , metav1.UpdateOptions {}); err != nil {
406+ return err
407+ }
408+ }
382409 return nil
383410}
384411
0 commit comments