-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
\t was not being recognized as tab in --format #123
Conversation
@umohnani8 UGH, looks like Red Hat CI failed due to not being able to connect to the Fedora registry (again). |
cmd/kpod/images.go
Outdated
func genImagesFormat(format string, quiet, noHeading, digests bool) string { | ||
if format != "" { | ||
// "\t" from the command line is not being recognized as a tab | ||
// replacing the string "\t" to a tab charcater if the user passes in "\t" |
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.
nit of a nit. charcater to character
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.
fixed
} | ||
format = "table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}\t" | ||
if size { | ||
format += "{{.Size}}\t" | ||
} | ||
return | ||
return format |
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 cleanup, missed this earlier.
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.
One minor nit, otherwise LGTM. Test issues don't look to be related, rather a flake.
When doing kpod images --format "{{.ID}}\t{{.Tag}}" the "\t" was being passed in as a string of "\" and "t" instead of as a tab character. Signed-off-by: umohnani8 <[email protected]>
LGTM |
@@ -302,19 +299,23 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru | |||
} | |||
|
|||
// generate the template based on conditions given | |||
func genPsFormat(quiet, size, namespace bool) (format string) { | |||
func genPsFormat(format string, quiet, size, namespace bool) string { |
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.
This function needs some additional work, since I don't seem to be able to pass multiple options at the same time.
Are these exclusive options? Do I get and error if I pass --format --quiet --size --namespace together?
Probably not related to this PR, but I think this is a potential bug.
Merging but @umohnani8 could you look into my question above. |
📌 Commit 6e783b5 has been approved by |
⚡ Test exempted: merge already tested. |
If a PR says "Fixes #123", make sure it removes skips and/or FIXME comments that reference issue 123. Signed-off-by: Ed Santiago <[email protected]>
When doing kpod images --format "{{.ID}}\t{{.Tag}}"
the "\t" was being passed in as a string of "" and "t"
instead of as a tab character.
Signed-off-by: umohnani8 [email protected]