Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pmm 12023 backups restore for pg operator #658

Open
wants to merge 3 commits into
base: PMM-11795-postgresql-operator
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -119,20 +118,17 @@ export const EditDBClusterPage: FC<EditDBClusterPageProps> = () => {
<div className={styles.optionsWrapper}>
{mode === 'create' && <DBClusterBasicOptions kubernetes={kubernetes} form={form} />}
<div className={styles.switchOptionsWrapper}>
{!!settings?.backupEnabled &&
form.getState().values.databaseType.value !== Databases.postgresql && <Restore form={form} />}
{!!settings?.backupEnabled && <Restore form={form} />}
<NetworkAndSecurity form={form} />
{!!settings?.backupEnabled &&
mode === 'create' &&
form.getState().values.databaseType.value !== Databases.postgresql && (
<DBaaSBackups
handleSubmit={handleSubmit}
pristine={pristine}
valid={valid}
form={form}
{...props}
/>
)}
{!!settings?.backupEnabled && mode === 'create' && (
<DBaaSBackups
handleSubmit={handleSubmit}
pristine={pristine}
valid={valid}
form={form}
{...props}
/>
)}
</div>
<DBClusterAdvancedOptions
showUnsafeConfigurationWarning={showUnsafeConfigurationWarning}
Expand Down
30 changes: 15 additions & 15 deletions public/app/percona/dbaas/components/DBCluster/PG.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down