reflect code review

This commit is contained in:
Felix Kunde 2020-03-06 17:18:28 +01:00
parent 23cb1c0d50
commit 9390ae3630
3 changed files with 3 additions and 8 deletions

View File

@ -19,7 +19,6 @@ var (
outOfCluster bool outOfCluster bool
version string version string
config spec.ControllerConfig config spec.ControllerConfig
controllerID string
) )
func mustParseDuration(d string) time.Duration { func mustParseDuration(d string) time.Duration {

View File

@ -95,7 +95,7 @@ lacks access rights to any of them (except K8s system namespaces like
'list pods' execute at the cluster scope and fail at the first violation of 'list pods' execute at the cluster scope and fail at the first violation of
access rights. access rights.
## Operators with defined ownership on certain Postgres clusters ## Operators with defined ownership of certain Postgres clusters
By default, multiple operators can only run together in one K8s cluster when By default, multiple operators can only run together in one K8s cluster when
isolated into their [own namespaces](administrator.md#specify-the-namespace-to-watch). isolated into their [own namespaces](administrator.md#specify-the-namespace-to-watch).

View File

@ -51,14 +51,10 @@ func (c *Controller) listClusters(options metav1.ListOptions) (*acidv1.Postgresq
c.logger.Debugf("watch only clusters with controllerID %q", c.controllerID) c.logger.Debugf("watch only clusters with controllerID %q", c.controllerID)
} }
for _, pg := range list.Items { for _, pg := range list.Items {
if pg.Error != "" { if pg.Error == "" && c.hasOwnership(&pg) {
continue
}
if !c.hasOwnership(&pg) {
continue
}
pgList.Items = append(pgList.Items, pg) pgList.Items = append(pgList.Items, pg)
} }
}
return &pgList, err return &pgList, err
} }