-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Snapshot & Restore] Fix repository types on Cloud (#125656)
* [Snapshot & Restore] Fix repository types on Cloud * [Snapshot & Restore] Move repo types tests into `on-prem` describe block Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 37dfc22) # Conflicts: # x-pack/plugins/snapshot_restore/server/routes/api/repositories.test.ts # x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts
- Loading branch information
Showing
5 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
x-pack/test/api_integration/apis/management/snapshot_restore/repositories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
const API_BASE_PATH = '/api/snapshot_restore'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
const deployment = getService('deployment'); | ||
|
||
describe('snapshot repositories', function () { | ||
describe('repository types', () => { | ||
it('returns a list of default repository types', async () => { | ||
const { body } = await supertest.get(`${API_BASE_PATH}/repository_types`).expect(200); | ||
|
||
const isCloud = await deployment.isCloud(); | ||
if (isCloud) { | ||
// on Cloud there are only module repo types | ||
expect(body).to.eql(['azure', 'gcs', 's3']); | ||
} else { | ||
// on prem there are module repo types and file system and url repo types | ||
expect(body).to.eql(['azure', 'gcs', 's3', 'fs', 'url']); | ||
} | ||
}); | ||
}); | ||
}); | ||
} |