Skip to content

Commit

Permalink
fix(coreos): handle coreos deprecation (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Sep 23, 2020
1 parent 78438ce commit 38ec012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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

0 comments on commit 38ec012

Please sign in to comment.