You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1293 introduced the InnerManifestClient/ManifestClient pairing of classes. ManifestClient wraps the InnerManifestClient (which was formerly just ManifestClient) so that we can mock its extension methods for testing.
The core issue is that GetImageDigestAsync makes a call to the Docker CLI, so mocking the InnerManifestClient by itself is not sufficient.
$"Found published digest '{digestSha}' for tag '{image}' but could not find a matching digest value from "+
$"the set of locally pulled digests for this tag: {string.Join(", ",digests) }. This most likely means that "+
"this tag has been updated since it was last pulled.");
}
returndigest;
}
We should re-architect this code so that we can mock only the InnerManifestClient's methods directly, and then remove the wrapper and rename.
I was thinking that we could separate out GetImageDigestAsync into ManifestServiceExtensions.GetImageDigestAsync and DockerService.GetLocalImageDigest. Then, callers (like the build command) could define their own method for checking local images first or reaching out to the ACR when a local image isn't found (or define a static method for that, taking both services as arguments, to provide a shared implementation for all of the callers).
The text was updated successfully, but these errors were encountered:
#1293 introduced the
InnerManifestClient
/ManifestClient
pairing of classes.ManifestClient
wraps theInnerManifestClient
(which was formerly justManifestClient
) so that we can mock its extension methods for testing.The core issue is that GetImageDigestAsync makes a call to the Docker CLI, so mocking the
InnerManifestClient
by itself is not sufficient.docker-tools/src/Microsoft.DotNet.ImageBuilder/src/ManifestServiceExtensions.cs
Lines 38 to 65 in 354896e
We should re-architect this code so that we can mock only the
InnerManifestClient
's methods directly, and then remove the wrapper and rename.I was thinking that we could separate out
GetImageDigestAsync
intoManifestServiceExtensions.GetImageDigestAsync
andDockerService.GetLocalImageDigest
. Then, callers (like the build command) could define their own method for checking local images first or reaching out to the ACR when a local image isn't found (or define a static method for that, taking both services as arguments, to provide a shared implementation for all of the callers).The text was updated successfully, but these errors were encountered: