-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make more robust cdk update ecr repo workflow to updates
Signed-off-by: Andre Kurait <akurait@amazon.com>
- Loading branch information
1 parent
d7224ce
commit ed71888
Showing
13 changed files
with
80 additions
and
42 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
33 changes: 33 additions & 0 deletions
33
deployment/cdk/opensearch-service-migration/test/jest.setup.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,33 @@ | ||
|
||
jest.mock('child_process', () => { | ||
const child_process = jest.requireActual('child_process'); | ||
|
||
// Define the list of expected Docker images as per CI.yml | ||
const expectedDockerImages = [ | ||
'docker.io/apache/kafka:3.7.0', | ||
'migrations/capture_proxy_es:latest', | ||
'migrations/capture_proxy:latest', | ||
'migrations/elasticsearch_searchguard:latest', | ||
'migrations/migration_console:latest', | ||
'migrations/reindex_from_snapshot:latest', | ||
'migrations/traffic_replayer:latest', | ||
'opensearchproject/opensearch:2', | ||
]; | ||
|
||
return { | ||
execSync: jest.fn().mockImplementation((command: string) => { | ||
if (expectedDockerImages.some(expectedImage => command.endsWith(expectedImage))) { | ||
if (command.startsWith('docker inspect')) { | ||
return Buffer.from("sha256:a6cdbbcf16c510f8e24c6b993"); | ||
} | ||
if (command.startsWith('docker pull')) { | ||
return Buffer.from(""); | ||
} | ||
} | ||
throw new Error(`Command not supported: ${command}`); | ||
}), | ||
// Uncomment and replace above to use the actual execSync, requires ./buildDockerImages.sh to be run locally | ||
// execSync: child_process.execSync, | ||
spawnSync: child_process.spawnSync, | ||
}; | ||
}); |
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
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