Skip to content

Fix integration tests that use latest distroless image and expect docker manifest format #3963

@emmileaf

Description

@emmileaf

With the recent distroless image switch to OCI-format manifests, Jib's integration testing breaks where gcr.io/distroless/base:latest is used in docker-format manifest-related testing. Opening this issue to track updating this where affected across the test suite.

V22ManifestTemplate manifestTemplate =
registryClient.pullManifest("latest", V22ManifestTemplate.class).getManifest();

Example from logs:

> Task :jib-core:integrationTest

com.google.cloud.tools.jib.registry.BlobPullerIntegrationTest > testPull FAILED
    com.google.cloud.tools.jib.registry.RegistryErrorException: Tried to pull image manifest for [gcr.io/distroless/base:latest](https://www.google.com/url?q=http://gcr.io/distroless/base:latest&sa=D) but failed because: Manifest with tag 'latest' has media type 'application/vnd.oci.image.index.v1+json', but client accepts 'application/vnd.docker.distribution.manifest.v2+json'.
        at com.google.cloud.tools.jib.registry.RegistryErrorExceptionBuilder.build(RegistryErrorExceptionBuilder.java:101)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.newRegistryErrorException(RegistryEndpointCaller.java:212)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:153)
        at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:114)
        at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:623)
        at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest(RegistryClient.java:434)
        at com.google.cloud.tools.jib.registry.BlobPullerIntegrationTest.testPull(BlobPullerIntegrationTest.java:45)

        Caused by:
        com.google.cloud.tools.jib.http.ResponseException: 404 Not Found
        GET [https://gcr.io/v2/distroless/base/manifests/latest](https://www.google.com/url?q=https://gcr.io/v2/distroless/base/manifests/latest&sa=D)
        {"errors":[{"code":"MANIFEST_UNKNOWN","message":"Manifest with tag 'latest' has media type 'application/vnd.oci.image.index.v1+json', but client accepts 'application/vnd.docker.distribution.manifest.v2+json'."}]}
            at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:355)
            at com.google.cloud.tools.jib.http.FailoverHttpClient.call(FailoverHttpClient.java:266)
            at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:138)
            ... 4 more

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions