rcjsuen / dockerfile-language-service

Dockerfile language service for providing an API to create feature-rich Dockerfile editors in JavaScript.
MIT License
16 stars 2 forks source link

Correct link range calculation if tag provided with a digest #120

Closed rcjsuen closed 9 months ago

rcjsuen commented 9 months ago

This is reproducible on 0.10.0 but was fixed in 0.11.0. We should still add a test for this though.


0.10.0:

const lib = require("dockerfile-language-service@0.10.0");
const service = lib.DockerfileLanguageServiceFactory.createLanguageService();
const links = service.computeLinks("FROM microsoft/dotnet:non-existent-tag@sha256:5483e2b609c0f66c3ebd96666de7b0a74537613b43565879ecb0d0a73e845d7d");
console.log(links[0].data);
_/dotnet:non-existent-tag/

0.11.0:

const lib = require("dockerfile-language-service@0.10.0");
const service = lib.DockerfileLanguageServiceFactory.createLanguageService();
const links = service.computeLinks("FROM microsoft/dotnet:non-existent-tag@sha256:5483e2b609c0f66c3ebd96666de7b0a74537613b43565879ecb0d0a73e845d7d");
console.log(links[0].data);
r/microsoft/dotnet/