From fa60dbab6020b73168ab11190a6e4d1f4d849a1e Mon Sep 17 00:00:00 2001 From: solovevayaroslavna Date: Wed, 19 Apr 2023 17:47:35 +0400 Subject: [PATCH 1/2] PMM-12023-backup/restore-for-PG-operator: allow backups/restore for pg --- .../EditDBClusterPage/EditDBClusterPage.tsx | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/public/app/percona/dbaas/components/DBCluster/EditDBClusterPage/EditDBClusterPage.tsx b/public/app/percona/dbaas/components/DBCluster/EditDBClusterPage/EditDBClusterPage.tsx index 53fe841d65253..71203b26d33b4 100644 --- a/public/app/percona/dbaas/components/DBCluster/EditDBClusterPage/EditDBClusterPage.tsx +++ b/public/app/percona/dbaas/components/DBCluster/EditDBClusterPage/EditDBClusterPage.tsx @@ -11,7 +11,6 @@ import { useShowPMMAddressWarning } from 'app/percona/shared/components/hooks/sh import { useSelector, useDispatch } from 'app/types'; import { FeatureLoader } from '../../../../shared/components/Elements/FeatureLoader'; -import { Databases } from '../../../../shared/core'; import { fetchStorageLocations } from '../../../../shared/core/reducers/backups/backupLocations'; import { resetAddDBClusterState } from '../../../../shared/core/reducers/dbaas/addDBCluster/addDBCluster'; import { resetDBCluster } from '../../../../shared/core/reducers/dbaas/dbaas'; @@ -119,20 +118,17 @@ export const EditDBClusterPage: FC = () => {
{mode === 'create' && }
- {!!settings?.backupEnabled && - form.getState().values.databaseType.value !== Databases.postgresql && } + {!!settings?.backupEnabled && } - {!!settings?.backupEnabled && - mode === 'create' && - form.getState().values.databaseType.value !== Databases.postgresql && ( - - )} + {!!settings?.backupEnabled && mode === 'create' && ( + + )}
Date: Wed, 19 Apr 2023 17:51:41 +0400 Subject: [PATCH 2/2] PMM-12023-backup/restore-for-PG-operator: backups/restore for pg --- .../dbaas/components/DBCluster/PG.service.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/public/app/percona/dbaas/components/DBCluster/PG.service.ts b/public/app/percona/dbaas/components/DBCluster/PG.service.ts index d3b219b8595e0..07bfd2c31ee2d 100644 --- a/public/app/percona/dbaas/components/DBCluster/PG.service.ts +++ b/public/app/percona/dbaas/components/DBCluster/PG.service.ts @@ -182,21 +182,21 @@ const toAPI = (dbCluster: DBCluster): DBClusterPayload => ({ disk_size: dbCluster.disk * BILLION, }, - // ...(dbCluster.backup && { - // backup: { - // location_id: dbCluster.backup?.locationId, - // keep_copies: dbCluster.backup?.keepCopies, - // cron_expression: dbCluster.backup?.cronExpression, - // service_account: dbCluster.backup?.serviceAccount, - // }, - // }), - // ...(dbCluster.restore && { - // restore: { - // location_id: dbCluster.restore?.locationId, - // destination: dbCluster.restore?.destination, - // secrets_name: dbCluster.restore?.secretsName, - // }, - // }), + ...(dbCluster.backup && { + backup: { + location_id: dbCluster.backup?.locationId, + keep_copies: dbCluster.backup?.keepCopies, + cron_expression: dbCluster.backup?.cronExpression, + service_account: dbCluster.backup?.serviceAccount, + }, + }), + ...(dbCluster.restore && { + restore: { + location_id: dbCluster.restore?.locationId, + destination: dbCluster.restore?.destination, + secrets_name: dbCluster.restore?.secretsName, + }, + }), }, // ...(dbCluster.template && { // template: {