diff --git a/src/utils/image-manager.ts b/src/utils/image-manager.ts index fda0d384..fd82334e 100644 --- a/src/utils/image-manager.ts +++ b/src/utils/image-manager.ts @@ -102,12 +102,7 @@ export const isImageFresh = async (deviceType: string, version: string) => { return false; } - const balena = getBalenaSdk(); - const lastModifiedDate = await balena.models.os.getLastModified( - deviceType, - version, - ); - return lastModifiedDate < createdDate; + return true; }; /** diff --git a/tests/utils/image-manager/image-manager.spec.ts b/tests/utils/image-manager/image-manager.spec.ts index 22494ad8..1519bd11 100644 --- a/tests/utils/image-manager/image-manager.spec.ts +++ b/tests/utils/image-manager/image-manager.spec.ts @@ -343,60 +343,6 @@ describe('image-manager', function () { afterEach(function () { this.utilsGetFileCreatedDate.restore(); }); - - describe('given the file was created before the os last modified time', function () { - beforeEach(function () { - this.osGetLastModified = stub(balena.models.os, 'getLastModified'); - this.osGetLastModified.returns( - Promise.resolve(new Date('2014-02-01T00:00:00.000Z')), - ); - }); - - afterEach(function () { - this.osGetLastModified.restore(); - }); - - it('should return false', function () { - const promise = imageManager.isImageFresh('raspberry-pi', '1.2.3'); - return expect(promise).to.eventually.be.false; - }); - }); - - describe('given the file was created after the os last modified time', function () { - beforeEach(function () { - this.osGetLastModified = stub(balena.models.os, 'getLastModified'); - this.osGetLastModified.returns( - Promise.resolve(new Date('2013-01-01T00:00:00.000Z')), - ); - }); - - afterEach(function () { - this.osGetLastModified.restore(); - }); - - it('should return true', function () { - const promise = imageManager.isImageFresh('raspberry-pi', '1.2.3'); - return expect(promise).to.eventually.be.true; - }); - }); - - describe('given the file was created just at the os last modified time', function () { - beforeEach(function () { - this.osGetLastModified = stub(balena.models.os, 'getLastModified'); - this.osGetLastModified.returns( - Promise.resolve(new Date('2014-00-01T00:00:00.000Z')), - ); - }); - - afterEach(function () { - this.osGetLastModified.restore(); - }); - - it('should return false', function () { - const promise = imageManager.isImageFresh('raspberry-pi', '1.2.3'); - return expect(promise).to.eventually.be.false; - }); - }); }); }); });