Skip to content

Commit fc80348

Browse files
Surayya Huseyn ZadaSurayya Huseyn Zada
authored andcommitted
extract error messages into Strings
1 parent f4f1754 commit fc80348

17 files changed

+389
-68
lines changed

src/Containers/Microsoft.NET.Build.Containers/ImagePublisher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ await PushToLocalRegistryAsync(
7373
telemetry,
7474
cancellationToken,
7575
destinationImageReference.LocalRegistry!.LoadAsync,
76-
logWarningForMultiArch : true).ConfigureAwait(false);
76+
logTipAboutContainerd : true).ConfigureAwait(false);
7777
break;
7878
case DestinationImageReferenceKind.RemoteRegistry:
7979
await PushToRemoteRegistryAsync(
@@ -111,7 +111,7 @@ private static async Task PushToLocalRegistryAsync<T>(
111111
Telemetry telemetry,
112112
CancellationToken cancellationToken,
113113
Func<T, SourceImageReference, DestinationImageReference, CancellationToken, Task> loadFunc,
114-
bool logWarningForMultiArch = false)
114+
bool logTipAboutContainerd = false)
115115
{
116116
ILocalRegistry localRegistry = destinationImageReference.LocalRegistry!;
117117
if (!(await localRegistry.IsAvailableAsync(cancellationToken).ConfigureAwait(false)))
@@ -148,9 +148,9 @@ private static async Task PushToLocalRegistryAsync<T>(
148148
{
149149
telemetry.LogLocalLoadError();
150150
Log.LogErrorFromException(dle, showStackTrace: false);
151-
if (logWarningForMultiArch && dle.Message.Contains("no such file or directory"))
151+
if (logTipAboutContainerd && dle.Message.Contains("no such file or directory"))
152152
{
153-
Log.LogMessage(MessageImportance.High, "Tip: For multi-arch image publishing, ensude that 'Use containerd for pulling and storing images' is checked in Docker Desktop settings.");
153+
Log.LogMessage(MessageImportance.High, Strings.TipToEnableContainerdForMultiArch);
154154
}
155155
}
156156
}

src/Containers/Microsoft.NET.Build.Containers/Resources/Strings.Designer.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Containers/Microsoft.NET.Build.Containers/Resources/Strings.resx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
</comment>
367367
</data>
368368
<data name="MixedMediaTypes" xml:space="preserve">
369-
<value>'mediaType' of manifests should be the same in manifest list (image index).</value>
369+
<value>'mediaType' of manifests should be the same in image index.</value>
370370
<comment/>
371371
</data>
372372
<data name="UnsupportedMediaType" xml:space="preserve">
@@ -382,13 +382,29 @@
382382
<comment/>
383383
</data>
384384
<data name="InvalidImageManifest" xml:space="preserve">
385-
<value>Cannot create image index because at least one of the provided images manifest is invalid.</value>
385+
<value>Cannot create image index because at least one of the provided images' manifest is invalid.</value>
386+
<comment/>
387+
</data>
388+
<data name="InvalidImageConfig" xml:space="preserve">
389+
<value>Cannot create image index because at least one of the provided images' config is invalid.</value>
390+
<comment/>
391+
</data>
392+
<data name="ImageConfigMissingArchitecture" xml:space="preserve">
393+
<value>Cannot create image index because at least one of the provided images' config is missing 'architecture'.</value>
394+
<comment/>
395+
</data>
396+
<data name="ImageConfigMissingOs" xml:space="preserve">
397+
<value>Cannot create image index because at least one of the provided images' config is missing 'os'.</value>
386398
<comment/>
387399
</data>
388400
<data name="ImageIndex_PodmanNotSupported" xml:space="preserve">
389401
<value>Image index creation for Podman is not supported.</value>
390402
<comment/>
391403
</data>
404+
<data name="TipToEnableContainerdForMultiArch" xml:space="preserve">
405+
<value>Tip: For multi-arch image publishing, ensude that 'Use containerd for pulling and storing images' is checked in Docker Desktop settings.</value>
406+
<comment/>
407+
</data>
392408
<data name="LocalDocker_FailedToGetConfig" xml:space="preserve">
393409
<value>Error while reading daemon config: {0}</value>
394410
<comment>{0} is the exception message that ends with period</comment>

src/Containers/Microsoft.NET.Build.Containers/Resources/xlf/Strings.cs.xlf

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Containers/Microsoft.NET.Build.Containers/Resources/xlf/Strings.de.xlf

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Containers/Microsoft.NET.Build.Containers/Resources/xlf/Strings.es.xlf

Lines changed: 24 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)