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

Kubelet: Use RepoDigest for ImageID when available #34473

Conversation

DirectXMan12
Copy link
Contributor

@DirectXMan12 DirectXMan12 commented Oct 10, 2016

Use manifest digest (as `docker-pullable://`) as ImageID when available (exposes a canonical, pullable image ID for containers).

Previously, we used the docker config digest (also called "image ID"
by Docker) for the value of the ImageID field in the container status.
This was not particularly useful, since the config manifest is not
what's used to identify the image in a registry, which uses the manifest
digest instead. Docker 1.12+ always populates the RepoDigests field
with the manifest digests, and Docker 1.10 and 1.11 populate it when
images are pulled by digest.

This commit changes ImageID to point to the the manifest digest when
available, using the prefix docker-pullable:// (instead of
docker://)

Related to #32159


This change is Reviewable

@DirectXMan12
Copy link
Contributor Author

cc @derekwaynecarr @ncdc @dchen1107

This is the new-and-improved "let's not break kubemark" edition.

I added a default "empty" InspectImageBy{ID,Ref} response in the fake docker client constructor (instead of being set in docker_manager_test.go, like the last PR), so it will apply to all users of the fake Docker client, including Kubemark, because it should not be possible to get a nil non-error response from InspectImageBy{ID,Ref}.

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Oct 10, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit 39c97aa127af7429e8ec1e4f86336375031cd146. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@DirectXMan12 DirectXMan12 force-pushed the feature/set-image-id-manifest-digest branch 2 times, most recently from e061af5 to 135f87d Compare October 10, 2016 19:13
@DirectXMan12
Copy link
Contributor Author

whoops, the "run on rebased branch" messed things up. Rebased manually and restored the necessary commit.

Previously, the `InspectImage` method of the Docker interface expected a
"pullable" image ref (name, tag, or manifest digest).  If you tried to
inspect an image by its ID (config digest), the inspect would fail to
validate the image against the input identifier.  This commit changes
the original method to be named `InspectImageByRef`, and introduces a
new method called `InspectImageByID` which validates that the input
identifier was an image ID.
Previously, we used the docker config digest (also called "image ID"
by Docker) for the value of the `ImageID` field in the container status.
This was not particularly useful, since the config manifest is not
what's used to identify the image in a registry, which uses the manifest
digest instead.  Docker 1.12+ always populates the RepoDigests field
with the manifest digests, and Docker 1.10 and 1.11 populate it when
images are pulled by digest.

This commit changes `ImageID` to point to the the manifest digest when
available, using the prefix `docker-pullable://` (instead of
`docker://`)
@derekwaynecarr derekwaynecarr added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Oct 10, 2016
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 10, 2016
@derekwaynecarr derekwaynecarr self-assigned this Oct 10, 2016
@derekwaynecarr derekwaynecarr added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2016
@DirectXMan12
Copy link
Contributor Author

(see also #33014 and #34386)

@ncdc
Copy link
Member

ncdc commented Oct 10, 2016

@k8s-bot gci gke e2e test this
@k8s-bot gke e2e test this

@derekwaynecarr
Copy link
Member

@k8s-bot gke e2e test this

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GKE smoke e2e failed for commit 135f87d. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 135f87d. Full PR test history.

The magic incantation to run this job again is @k8s-bot gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit c50af35 into kubernetes:master Oct 11, 2016
@DirectXMan12 DirectXMan12 deleted the feature/set-image-id-manifest-digest branch October 11, 2016 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants