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

Detect docker image SHA instead of tag #328

Conversation

StefanoFioravanzo
Copy link
Member

This PR improves the detection of the base docker image being used by the Pod, retrieving the image SHA (when available).
This ensures that reproducibility even when the base image has a non-reproducible tag (e.g. latest)

Stefano Fioravanzo added 2 commits April 9, 2021 11:59
Just reading the Pod spec's container image is not enough to have a
reproducible reference to the current image, because an image tag can be
re-assigned to newer builds, in the future (e.g. when using the `latest`
tag). The only way to have reproducible reference is by using the
image manifest's `sha`.

Kubernetes exposes this in the Pod's `status`, under `containerStatuses`
[1], in the field `imageID`. In the case this field is empty (this could
happen when the image was built locally), then fallback to reading the
Pod's container `image` field.

[1] https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#containerstatus-v1-core  # noqa: 501

Signed-off-by: Stefano Fioravanzo <[email protected]>
Reviewed-by: Ilias Katsakioris <[email protected]>
Use common util to get the workflow

Signed-off-by: Stefano Fioravanzo <[email protected]>
Reviewed-by: Ilias Katsakioris <[email protected]>
@elikatsis elikatsis merged commit 1aafbfa into kubeflow-kale:master Apr 9, 2021
@elikatsis elikatsis deleted the feature-stefano-up-docker-image-detection branch April 9, 2021 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants