From 21bf941e635197cc75c78d0c3db5169edf0075e9 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Wed, 11 Nov 2020 14:54:26 -0600 Subject: [PATCH] Handle non-matching tag names between manifest and image info file (#693) --- .../src/Commands/CopyAcrImagesCommand.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.ImageBuilder/src/Commands/CopyAcrImagesCommand.cs b/src/Microsoft.DotNet.ImageBuilder/src/Commands/CopyAcrImagesCommand.cs index bff71f58..23af5ae8 100644 --- a/src/Microsoft.DotNet.ImageBuilder/src/Commands/CopyAcrImagesCommand.cs +++ b/src/Microsoft.DotNet.ImageBuilder/src/Commands/CopyAcrImagesCommand.cs @@ -82,8 +82,11 @@ public override async Task ExecuteAsync() string sourceTag = GetSourceTag(destinationTag); tags.Add((sourceTag, destinationTag)); - TagInfo tagInfo = platformData.PlatformInfo.Tags.First(tagInfo => tagInfo.Name == tag); - if (tagInfo.SyndicatedRepo != null) + TagInfo tagInfo = platformData.PlatformInfo.Tags.FirstOrDefault(tagInfo => tagInfo.Name == tag); + // There may not be a matching tag due to dynamic tag names. For now, we'll say that + // syndication is not supported for dynamically named tags. + // See https://github.com/dotnet/docker-tools/issues/686 + if (tagInfo?.SyndicatedRepo != null) { foreach (string syndicatedDestinationTagName in tagInfo.SyndicatedDestinationTags) {