diff --git a/.github/workflows/pr_check_workflow.yml b/.github/workflows/pr_check_workflow.yml index 34db23d69eec..efe45a5c5ad5 100644 --- a/.github/workflows/pr_check_workflow.yml +++ b/.github/workflows/pr_check_workflow.yml @@ -18,6 +18,7 @@ env: TEST_OPENSEARCH_DASHBOARDS_PORT: 6610 TEST_OPENSEARCH_TRANSPORT_PORT: 9403 TEST_OPENSEARCH_PORT: 9400 + OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true jobs: build-lint-test: diff --git a/packages/osd-opensearch/src/artifact.js b/packages/osd-opensearch/src/artifact.js index cc1f7a9c8ea6..e57987f2af1c 100644 --- a/packages/osd-opensearch/src/artifact.js +++ b/packages/osd-opensearch/src/artifact.js @@ -89,6 +89,11 @@ function shouldUseUnverifiedSnapshot() { return !!process.env.OSD_OPENSEARCH_SNAPSHOT_USE_UNVERIFIED; } +// Setting this flag provides an easy way to skip comparing the checksum +function skipVerifyChecksum() { + return !!process.env.OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM; +} + async function fetchSnapshotManifest(url, log) { log.info('Downloading snapshot manifest from %s', chalk.bold(url)); @@ -327,7 +332,9 @@ exports.Artifact = class Artifact { return; } - await this._verifyChecksum(artifactResp); + if (!skipVerifyChecksum()) { + await this._verifyChecksum(artifactResp); + } // cache the etag for future downloads cache.writeMeta(dest, { etag: artifactResp.etag }); diff --git a/packages/osd-opensearch/src/artifact.test.js b/packages/osd-opensearch/src/artifact.test.js index 5deddaf8e52a..2711f942bf1b 100644 --- a/packages/osd-opensearch/src/artifact.test.js +++ b/packages/osd-opensearch/src/artifact.test.js @@ -77,6 +77,7 @@ const previousEnvVars = {}; const ENV_VARS_TO_RESET = [ 'OPENSEARCH_SNAPSHOT_MANIFEST', 'OSD_OPENSEARCH_SNAPSHOT_USE_UNVERIFIED', + 'OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM', ]; beforeAll(() => {