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

fix(coreos): handle coreos deprecation #270

Merged
merged 2 commits into from Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -259,7 +259,9 @@ export class GCEImages {
images = images.filter(this._filterDeprecated);
}

if (images.length === 0) {
// All CoreOS images are now deprecated, See:
// https://cloud.google.com/compute/docs/eol/coreOS
if (images.length === 0 && !osParts.name.startsWith('coreos')) {
throw new Error('Could not find a suitable image.');
}
return images;
Expand Down
2 changes: 2 additions & 0 deletions system-test/test.ts
Expand Up @@ -74,6 +74,8 @@ describe('system tests', () => {
const images = (await gceImages.getLatest()) as ImageMap;
assert.strictEqual(typeof images, 'object');
Object.keys(images).forEach(osName => {
// https://cloud.google.com/compute/docs/eol/coreOS
if (osName.startsWith('coreos')) return;
assert.strictEqual(typeof images[osName], 'object');
});
});
Expand Down