-
Notifications
You must be signed in to change notification settings - Fork 8
CLOUDP-318984: Print image digest SHA256 in build logs #126
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
Conversation
lib/sonar/builders/docker.py
Outdated
@@ -47,7 +47,10 @@ def docker_build( | |||
) | |||
|
|||
client = docker_client() | |||
return client.images.get(image_name) | |||
image = client.images.get(image_name) | |||
logger.info("Successfully build docker-image, SHA256: {}".format(image.id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add the sha as an attribute in the trace - unfortunately logs are not saved globally for search.
example:
mongodb-kubernetes/pipeline.py
Lines 375 to 380 in 3178929
"""Calls sonar to build `image_name` with arguments defined in `args`.""" | |
span = trace.get_current_span() | |
span.set_attribute("mck.image_name", image_name) | |
span.set_attribute("mck.inventory", inventory) | |
if args: | |
span.set_attribute("mck.build_args", str(args)) |
then you can see it under your linked trace in the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added digest to trace: a7332a2
Waiting for pipeline to validate my changes in Honeycomb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice - seems to work
https://ui.honeycomb.io/mongodb-4b/environments/production/result/2NA2RSzW66K
a7332a2
to
2f47415
Compare
Summary
CLOUDP-318984: Print image digest SHA256 in build logs
Proof of Work
Checklist