diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index bdb687580..7278544c0 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -15,8 +15,8 @@ configuration: kubernetes: pod_service_account_name: operator pod_terminate_grace_period: 5m - pdb_name_format: postgres-{cluster}-pdb - secret_name_template: {username}.{cluster}.credentials.{tprkind}.{tprgroup} + pdb_name_format: "postgres-{cluster}-pdb" + secret_name_template: "{username}.{cluster}.credentials.{tprkind}.{tprgroup}" oauth_token_secret_name: postgresql-operator pod_role_label: spilo-role cluster_labels: @@ -30,7 +30,7 @@ configuration: postgres_pod_resources: default_cpu_request: 100m default_memory_request: 100Mi - default_cpu_limit: 3 + default_cpu_limit: "3" default_memory_limit: 1Gi timeouts: resource_check_interval: 3s @@ -42,8 +42,8 @@ configuration: load_balancer: enable_master_load_balancer: false enable_replica_load_balancer: false - master_dns_name_format: {cluster}.{team}.{hostedzone} - replica_dns_name_format: {cluster}-repl.{team}.{hostedzone} + master_dns_name_format: "{cluster}.{team}.{hostedzone}" + replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}" aws_or_gcp: # db_hosted_zone: "" # wal_s3_bucket: "" diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index 8633a3f5a..44e906ad3 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -169,7 +169,7 @@ func (c *Controller) initController() { if err := c.createOperatorCRD(); err != nil { c.logger.Fatalf("could not register Operator Configuration CustomResourceDefinition: %v", err) } - if cfg, err := c.readOperatorConfigurationFromCRD(configObjectName); err != nil { + if cfg, err := c.readOperatorConfigurationFromCRD(spec.GetOperatorNamespace(), configObjectName); err != nil { c.logger.Fatalf("unable to read operator configuration: %v", err) } else { c.opConfig = c.importConfigurationFromCRD(&cfg.Configuration) diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index b6d177c96..f6bf5cc59 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -9,14 +9,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -func (c *Controller) readOperatorConfigurationFromCRD(configObjectName string) (*config.OperatorConfiguration, error) { +func (c *Controller) readOperatorConfigurationFromCRD(configObjectNamespace, configObjectName string) (*config.OperatorConfiguration, error) { var ( config config.OperatorConfiguration ) req := c.KubeClient.CRDREST.Get(). Name(configObjectName). - Namespace(c.opConfig.WatchedNamespace). + Namespace(configObjectNamespace). Resource(constants.OperatorConfigCRDResource). VersionedParams(&metav1.ListOptions{ResourceVersion: "0"}, metav1.ParameterCodec)