Skip to content

[v0.10] Lazily load attestation data in imagetools inspect#1546

Merged
jedevc merged 2 commits intodocker:v0.10from
jedevc:v0.10-inspect-lazy-attestations
Jan 24, 2023
Merged

[v0.10] Lazily load attestation data in imagetools inspect#1546
jedevc merged 2 commits intodocker:v0.10from
jedevc:v0.10-inspect-lazy-attestations

Conversation

@jedevc
Copy link
Copy Markdown
Collaborator

@jedevc jedevc commented Jan 24, 2023

🍒 Cherry-pick of #1505.

This refactor ensures that the attestations are not output in the JSON
output for "{{ json . }}", and additionally allows future refactors to
dynamically load the attestation contents, ensuring faster performance
when attestations are not used in the output.

Signed-off-by: Justin Chadwell <me@jedevc.com>
Delay loading the attestation data immediately, and only compute it upon
request. We do this using a deferred function which allows to define the
computation in the same place as before, but perform the computation
later.

With this patch, we ensure that the attestation data is only pulled from
the remote if it is actually referenced in the format string -
otherwise, we can skip it, for improved performance.

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc jedevc requested a review from tonistiigi January 24, 2023 12:12
@jedevc jedevc added this to the v0.10.1 milestone Jan 24, 2023
@jedevc jedevc merged commit 6d93562 into docker:v0.10 Jan 24, 2023
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