Ensure empty build cache is represented as empty JSON array#42607
Merged
thaJeztah merged 2 commits intomoby:masterfrom Jul 9, 2021
Merged
Ensure empty build cache is represented as empty JSON array#42607thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah merged 2 commits intomoby:masterfrom
Conversation
Ensure empty `BuildCache` field is represented as empty JSON array(`[]`) instead of `null` to be consistent with `Images`, `Containers` etc. Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
thaJeztah
requested changes
Jul 9, 2021
Member
thaJeztah
left a comment
There was a problem hiding this comment.
can you fix the trailing comma's in the first commit?
Co-authored-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
8946769 to
83e3dd6
Compare
Member
|
Flaky test; tracked through #42482 Flaky test on Windows 2022 (created #42612) |
Member
|
One more; was flaky before (#38293, also mentioned in #41561), but hadn't seen that one in a while kicked CI again |
Member
|
Ignoring the |
mfeit-internet2
pushed a commit
to mfeit-internet2/moby
that referenced
this pull request
Jul 13, 2021
…ting Ensure empty build cache is represented as empty JSON array Signed-off-by: Mark Feit <mfeit@internet2.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42605 Refs #42605 (comment)
- What I did
Ensure empty
BuildCachefield is represented as empty JSON array([]) instead ofnullto be consistent withImages,Containersetc.- How I did it
Initialize the struct field with an empty slice if
buildCacheisnil.Note, the empty slice could be potentially defined as global variable and reused to avoid unnecessary allocations, but that is an optimization not worth doing here in my opinion
- How to verify it
curl -s --unix-socket /var/run/docker.sock http://localhost/system/df | jqon empty daemon should output:{ "LayersSize": 0, "Images": [], "Containers": [], "Volumes": [], "BuildCache": [], "BuilderSize": 0 }- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)