|
79 | 79 |
|
80 | 80 | OPERATOR_API_URL = getenv('OPERATOR_API_URL', 'http://postgres-operator') |
81 | 81 | OPERATOR_CLUSTER_NAME_LABEL = getenv('OPERATOR_CLUSTER_NAME_LABEL', 'cluster-name') |
82 | | -OPERATOR_UI_CONFIG = getenv('OPERATOR_UI_CONFIG', '{}') |
| 82 | +OPERATOR_UI_CONFIG = loads(getenv('OPERATOR_UI_CONFIG', '{}')) |
83 | 83 | OPERATOR_UI_MAINTENANCE_CHECK = getenv('OPERATOR_UI_MAINTENANCE_CHECK', '{}') |
84 | 84 | READ_ONLY_MODE = getenv('READ_ONLY_MODE', False) in [True, 'true'] |
85 | 85 | SPILO_S3_BACKUP_PREFIX = getenv('SPILO_S3_BACKUP_PREFIX', 'spilo/') |
@@ -348,7 +348,7 @@ def index(): |
348 | 348 | @authorize |
349 | 349 | def get_config(): |
350 | 350 | config = DEFAULT_UI_CONFIG.copy() |
351 | | - config.update(loads(OPERATOR_UI_CONFIG)) |
| 351 | + config.update(OPERATOR_UI_CONFIG) |
352 | 352 |
|
353 | 353 | config['namespaces'] = ( |
354 | 354 | [TARGET_NAMESPACE] |
@@ -508,10 +508,10 @@ def get_postgresqls(): |
508 | 508 | postgresqls = [ |
509 | 509 | { |
510 | 510 | 'nodes': spec.get('numberOfInstances', ''), |
511 | | - 'memory': spec.get('resources', {}).get('requests', {}).get('memory', 0), |
512 | | - 'memory_limit': spec.get('resources', {}).get('limits', {}).get('memory', 0), |
513 | | - 'cpu': spec.get('resources', {}).get('requests', {}).get('cpu', 0), |
514 | | - 'cpu_limit': spec.get('resources', {}).get('limits', {}).get('cpu', 0), |
| 511 | + 'memory': spec.get('resources', {}).get('requests', {}).get('memory', OPERATOR_UI_CONFIG.get("default_memory", DEFAULT_MEMORY)), |
| 512 | + 'memory_limit': spec.get('resources', {}).get('limits', {}).get('memory', OPERATOR_UI_CONFIG.get("default_memory_limit", DEFAULT_MEMORY_LIMIT)), |
| 513 | + 'cpu': spec.get('resources', {}).get('requests', {}).get('cpu', OPERATOR_UI_CONFIG.get("default_cpu", DEFAULT_CPU)), |
| 514 | + 'cpu_limit': spec.get('resources', {}).get('limits', {}).get('cpu', OPERATOR_UI_CONFIG.get("default_cpu_limit", DEFAULT_CPU_LIMIT)), |
515 | 515 | 'volume_size': spec.get('volume', {}).get('size', 0), |
516 | 516 | 'iops': spec.get('volume', {}).get('iops', 3000), |
517 | 517 | 'throughput': spec.get('volume', {}).get('throughput', 125), |
|
0 commit comments