[Snapshot & Restore] Add support for S3 onezone_ia (#154346)

This commit is contained in:
Ignacio Rivas 2023-04-04 18:39:40 +02:00 committed by GitHub
parent e9bed322e9
commit bc245ea173
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View file

@ -593,5 +593,46 @@ describe('<RepositoryAdd />', () => {
})
);
});
test('should correctly set the onezone_ia storage class', async () => {
const { form, actions, component } = testBed;
const s3Repository = getRepository({
type: 's3',
settings: {
bucket: 'test_bucket',
storageClass: 'onezone_ia',
},
});
// Fill step 1 required fields and go to step 2
form.setInputValue('nameInput', s3Repository.name);
actions.selectRepositoryType(s3Repository.type);
actions.clickNextButton();
// Fill step 2
form.setInputValue('bucketInput', s3Repository.settings.bucket);
form.setSelectValue('storageClassSelect', s3Repository.settings.storageClass);
await act(async () => {
actions.clickSubmitButton();
});
component.update();
expect(httpSetup.put).toHaveBeenLastCalledWith(
`${API_BASE_PATH}repositories`,
expect.objectContaining({
body: JSON.stringify({
name: s3Repository.name,
type: s3Repository.type,
settings: {
bucket: s3Repository.settings.bucket,
storageClass: s3Repository.settings.storageClass,
},
}),
})
);
});
});
});

View file

@ -76,6 +76,7 @@ export const S3Settings: React.FunctionComponent<Props> = ({
'reduced_redundancy',
'standard_ia',
'intelligent_tiering',
'onezone_ia',
].map((option) => ({
value: option,
text: option,