mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 08:51:59 +02:00
Implement per-cluster maintenance window for Postgres automatic upgrade (#2710)
* implement maintenance window for major version upgrade * e2e test: fix major version upgrade test and extend with the time window * unit test: add iteration to test isInMaintenanceWindow * UI: show the window and enable edit via UI
This commit is contained in:
@@ -465,6 +465,7 @@ def get_postgresqls():
|
||||
'status': status,
|
||||
'num_elb': spec.get('enableMasterLoadBalancer', 0) + spec.get('enableReplicaLoadBalancer', 0) + \
|
||||
spec.get('enableMasterPoolerLoadBalancer', 0) + spec.get('enableReplicaPoolerLoadBalancer', 0),
|
||||
'maintenance_windows': spec.get('maintenanceWindows', []),
|
||||
}
|
||||
for cluster in these(
|
||||
read_postgresqls(
|
||||
@@ -566,6 +567,11 @@ def update_postgresql(namespace: str, cluster: str):
|
||||
return fail('allowedSourceRanges invalid')
|
||||
spec['allowedSourceRanges'] = postgresql['spec']['allowedSourceRanges']
|
||||
|
||||
if 'maintenanceWindows' in postgresql['spec']:
|
||||
if not isinstance(postgresql['spec']['maintenanceWindows'], list):
|
||||
return fail('maintenanceWindows invalid')
|
||||
spec['maintenanceWindows'] = postgresql['spec']['maintenanceWindows']
|
||||
|
||||
if 'numberOfInstances' in postgresql['spec']:
|
||||
if not isinstance(postgresql['spec']['numberOfInstances'], int):
|
||||
return fail('numberOfInstances invalid')
|
||||
|
||||
Reference in New Issue
Block a user