refactor: newDigestShort

This commit is contained in:
Rhys Arkins 2021-04-17 22:26:17 +02:00
parent ac2ba7dd74
commit d3a477afd6
3 changed files with 0 additions and 16 deletions

View file

@ -144,7 +144,6 @@ export interface LookupUpdate {
isRange?: boolean; isRange?: boolean;
isRollback?: boolean; isRollback?: boolean;
newDigest?: string; newDigest?: string;
newDigestShort?: string;
newMajor?: number; newMajor?: number;
newMinor?: number; newMinor?: number;
newValue: string; newValue: string;

View file

@ -147,7 +147,6 @@ Object {
"blockedByPin": true, "blockedByPin": true,
"bucket": "non-major", "bucket": "non-major",
"newDigest": "sha256:abcdef1234567890", "newDigest": "sha256:abcdef1234567890",
"newDigestShort": "abcdef1",
"newMajor": 8, "newMajor": 8,
"newMinor": 1, "newMinor": 1,
"newValue": "8.1.0", "newValue": "8.1.0",
@ -156,7 +155,6 @@ Object {
}, },
Object { Object {
"newDigest": "sha256:0123456789abcdef", "newDigest": "sha256:0123456789abcdef",
"newDigestShort": "0123456",
"newValue": "8.0.0", "newValue": "8.0.0",
"updateType": "pin", "updateType": "pin",
}, },
@ -170,7 +168,6 @@ Object {
"updates": Array [ "updates": Array [
Object { Object {
"newDigest": "sha256:abcdef1234567890", "newDigest": "sha256:abcdef1234567890",
"newDigestShort": "abcdef1",
"newValue": "alpine", "newValue": "alpine",
"updateType": "pin", "updateType": "pin",
}, },
@ -190,7 +187,6 @@ Object {
"updates": Array [ "updates": Array [
Object { Object {
"newDigest": "sha256:abcdef1234567890", "newDigest": "sha256:abcdef1234567890",
"newDigestShort": "abcdef1",
"newValue": "8.1.0", "newValue": "8.1.0",
"updateType": "pin", "updateType": "pin",
}, },
@ -212,7 +208,6 @@ Object {
Object { Object {
"bucket": "non-major", "bucket": "non-major",
"newDigest": "sha256:abcdef1234567890", "newDigest": "sha256:abcdef1234567890",
"newDigestShort": "abcdef1",
"newMajor": 8, "newMajor": 8,
"newMinor": 1, "newMinor": 1,
"newValue": "8.1.0", "newValue": "8.1.0",
@ -221,7 +216,6 @@ Object {
}, },
Object { Object {
"newDigest": "sha256:0123456789abcdef", "newDigest": "sha256:0123456789abcdef",
"newDigestShort": "0123456",
"newValue": "8.0.0", "newValue": "8.0.0",
"updateType": "digest", "updateType": "digest",
}, },
@ -235,7 +229,6 @@ Object {
"updates": Array [ "updates": Array [
Object { Object {
"newDigest": "sha256:abcdef1234567890", "newDigest": "sha256:abcdef1234567890",
"newDigestShort": "abcdef1",
"newValue": "alpine", "newValue": "alpine",
"updateType": "digest", "updateType": "digest",
}, },
@ -250,7 +243,6 @@ Object {
"updates": Array [ "updates": Array [
Object { Object {
"newDigest": "4b825dc642cb6eb9a060e54bf8d69288fbee4904", "newDigest": "4b825dc642cb6eb9a060e54bf8d69288fbee4904",
"newDigestShort": "4b825dc",
"newValue": undefined, "newValue": undefined,
"newVersion": undefined, "newVersion": undefined,
"updateType": "digest", "updateType": "digest",

View file

@ -328,13 +328,6 @@ export async function lookupUpdates(
if (pinDigests || currentDigest) { if (pinDigests || currentDigest) {
update.newDigest = update.newDigest =
update.newDigest || (await getDigest(config, update.newValue)); update.newDigest || (await getDigest(config, update.newValue));
if (update.newDigest) {
update.newDigestShort = update.newDigest
.replace('sha256:', '')
.substring(0, 7);
} else {
logger.debug({ newValue: update.newValue }, 'Could not getDigest');
}
} }
} }
} }