Merge branch 'experiment/crd_configuration' of github.com:zalando-incubator/postgres-operator into experiment/crd_configuration

This commit is contained in:
Oleksii Kliukin
2018-06-13 14:41:12 +02:00
3 changed files with 8 additions and 8 deletions
@@ -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: ""
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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)