Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

umohnani8
Copy link
Member

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]

@umohnani8
Copy link
Member Author

@rhatdan @mheon @baude PTAL

@TomSweeneyRedHat
Copy link
Member

@umohnani8 UGH, looks like Red Hat CI failed due to not being able to connect to the Fedora registry (again).

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"
Copy link
Member

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

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a 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]>
@umohnani8
Copy link
Member Author

@rhatdan @mheon tests pass, PTAL

@mheon
Copy link
Member

mheon commented Dec 12, 2017

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 {
Copy link
Member

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.

@rhatdan
Copy link
Member

rhatdan commented Dec 12, 2017

Merging but @umohnani8 could you look into my question above.
@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 6e783b5 has been approved by rhatdan

@rh-atomic-bot
Copy link
Collaborator

⚡ Test exempted: merge already tested.

@umohnani8 umohnani8 deleted the printing branch March 16, 2018 14:41
openshift-merge-robot pushed a commit that referenced this pull request Jul 28, 2022
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]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants