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

WX-1106 Add logging for failed docker manifest pulls #7135

Merged
merged 8 commits into from
May 18, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ abstract class DockerRegistryV2Abstract(override val config: DockerRegistryConfi
protected def getDockerResponse(token: Option[String], dockerInfoContext: DockerInfoContext)(implicit client: Client[IO]): IO[DockerInfoSuccessResponse] = {
val requestDockerManifest = manifestRequest(token, dockerInfoContext.dockerImageID, AcceptDockerManifestV2Header)
lazy val requestOCIManifest = manifestRequest(token, dockerInfoContext.dockerImageID, AcceptOCIIndexV1Header)
def tryOCIManifest(err: Throwable) = executeRequest(requestOCIManifest, handleManifestResponse(dockerInfoContext, token))
def tryOCIManifest(err: Throwable) = {
logger.info("Manifest request failed for docker manifest V2, falling back to OCI manifest", err)
kraefrei marked this conversation as resolved.
Show resolved Hide resolved
executeRequest(requestOCIManifest, handleManifestResponse(dockerInfoContext, token))
}
// Try to execute a request using the Docker Manifest format, and if that fails, try using the newer OCI manifest format
executeRequest(requestDockerManifest, handleManifestResponse(dockerInfoContext, token))
.handleErrorWith(tryOCIManifest)
Expand Down