image/label: print more characters of label keys#7618
Merged
dmcgowan merged 1 commit intocontainerd:mainfrom Dec 23, 2022
Merged
image/label: print more characters of label keys#7618dmcgowan merged 1 commit intocontainerd:mainfrom
dmcgowan merged 1 commit intocontainerd:mainfrom
Conversation
7a0522a to
5d023c4
Compare
kzys
approved these changes
Nov 3, 2022
Member
Author
Sure. Will add some tests for it later in this PR of next version |
Member
|
@changweige would you just add unit case in this pr? the change is small. it is no need to seperate it. |
Member
Author
Yes. I am intending to add UT for it but was occupied these days. I will soon re-push the PR with a UT case |
c4a8025 to
f9b3bfa
Compare
Member
Author
dmcgowan
approved these changes
Nov 18, 2022
mikebrow
reviewed
Nov 18, 2022
Member
mikebrow
left a comment
There was a problem hiding this comment.
nit comment to explain the new const
| const ( | ||
| maxSize = 4096 | ||
| maxSize = 4096 | ||
| keyMaxLen = 64 |
Member
There was a problem hiding this comment.
suggest comment line ... // maximum length of key portion of error message if len of key + len of value > maxSize
Member
Author
There was a problem hiding this comment.
Thanks for your suggestion. The comment has been added.
Like stargz and nydus remote snapshotter, some snapshots lables are introduced and passed to snapshotter from containerd automatically. The label keys' length are all longer than 10. The limitation of 10 characters makes it harder to debug what label is not appropriate. So we'd better to print more of the wrong label. Signed-off-by: Changwei Ge <[email protected]>
f9b3bfa to
176e8d3
Compare
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.
Like stargz and nydus remote snapshotter, some snapshots lables are introduced and passed to snapshotter from containerd automatically. The label keys' lengths are all longer than 10. Most of them are around 40-50 chars.
The limitation of 10 characters makes it harder to debug what label is not appropriate. So we'd better print more of the wrong label.
Signed-off-by: Changwei Ge [email protected]