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

EOL annotation fails when EOL Dockerfiles exist but images do not exist in ACR #1507

Open
mthalman opened this issue Nov 26, 2024 · 2 comments

Comments

@mthalman
Copy link
Member

There can be circumstances where the EOL annotation logic will fail when attempting to query the metadata about an image in the ACR, where the image does not exist.

This occurs when the following conditions occur:

  • A .NET version has become EOL (such as 6.0) and the build has marked all of those images as EOL.
  • Those Dockerfiles are not yet removed from the repo.
  • ACR cleanup has run which deletes those EOL images from the ACR.
  • A subsequent build runs which builds Dockerfiles other than the EOL ones.

The issue here is in the generateEolAnnotationData command. It will see that the EOL Dockerfiles exist and that they should be added to the list of digests to be annotated here:

private IEnumerable<EolDigestData> GetProductEolDigests(ImageData image, Dictionary<string, DateOnly> productEolDates)
{
if (image.ProductVersion == null)
{
return [];
}
// Check if the version has a pre-release label. If so, it's not EOL by definition.
if (image.ProductVersion.Contains("-"))
{
return [];
}
string dotnetVersion = Version.Parse(image.ProductVersion).ToString(2);
if (!productEolDates.TryGetValue(dotnetVersion, out DateOnly date))
{
return [];
}
return image.GetAllImageDigestInfos().Select(val =>
new EolDigestData(val.Digest)
{
Tag = GetLongestTag(val.Tags),
EolDate = date
});
}
. The problem is that the images shouldn't have been added in the first place, or at least checked to see whether they exist before attempting to get their metadata.

Example failing build (internal link)

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant