From 94eaef478df7ffd45756b7250fc858414d5f87a4 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Fri, 4 Dec 2020 16:09:52 +0100 Subject: [PATCH] minor changes --- charts/postgres-operator/values-crd.yaml | 2 +- pkg/cluster/util.go | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/charts/postgres-operator/values-crd.yaml b/charts/postgres-operator/values-crd.yaml index 00d82e0ef..211d46dbe 100644 --- a/charts/postgres-operator/values-crd.yaml +++ b/charts/postgres-operator/values-crd.yaml @@ -90,7 +90,7 @@ configKubernetes: # infrastructure_roles_secret_name: postgresql-infrastructure-roles # list of annotation keys that can be inherited from the cluster manifest - # inherited_labels: + # inherited_annotations: # - owned-by # list of label keys that can be inherited from the cluster manifest diff --git a/pkg/cluster/util.go b/pkg/cluster/util.go index 8004af175..670ffe290 100644 --- a/pkg/cluster/util.go +++ b/pkg/cluster/util.go @@ -271,13 +271,9 @@ func (c *Cluster) getTeamMembers(teamID string) ([]string, error) { return members, nil } -// Returns annotations used to create or list k8s objects such as pods -// For backward compatibility, shouldAddExtraLabels must be false -// when listing k8s objects. See operator PR #252 +// Returns annotations to be passed to child objects func (c *Cluster) annotationsSet(annotations map[string]string) map[string]string { - var result map[string]string - // allow to inherit certain labels from the 'postgres' object if spec, err := c.GetSpec(); err == nil { for k, v := range spec.ObjectMeta.Annotations { @@ -292,10 +288,10 @@ func (c *Cluster) annotationsSet(annotations map[string]string) map[string]strin } if len(annotations) > 0 { - result = annotations + return annotations } - return result + return nil } func (c *Cluster) waitForPodLabel(podEvents chan PodEvent, stopChan chan struct{}, role *PostgresRole) (*v1.Pod, error) {