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

Regression: Output formatting no longer supports join (Go template) #8773

Closed
matusmarhefka opened this issue Dec 18, 2020 · 7 comments · Fixed by #9313
Closed

Regression: Output formatting no longer supports join (Go template) #8773

matusmarhefka opened this issue Dec 18, 2020 · 7 comments · Fixed by #9313
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@matusmarhefka
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Podman (v2.2.1) no longer supports join Go template when formatting output using --format. This is a regression compared to older podman (e.g. in F31). I haven't tested all Go templates from https://docs.docker.com/config/formatting/ so join might not be the only one which is not working.

Steps to reproduce the issue:

  1. podman pull fedora

  2. podman inspect fedora --format '{{join .Config.Env "\n"}}'

Describe the results you received:
ERRO[0000] Error printing inspect output: template: all inspect:1: function "join" not defined

Describe the results you expected:

DISTTAG=f33container
FGC=f33
container=oci

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      2.2.1
API Version:  2.1.0
Go Version:   go1.15.5
Built:        Tue Dec  8 09:37:50 2020
OS/Arch:      linux/amd64

Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.2.1-1.fc33.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes, latest released in Fedora 33.

Additional information:

On Fedora 31 this works as expected:

# podman inspect fedora --format '{{join .Config.Env "\n"}}'
DISTTAG=f33container
FGC=f33
container=oci
# rpm -q podman 
podman-2.1.1-3.fc31.x86_64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 18, 2020
@mheon
Copy link
Member

mheon commented Dec 18, 2020

@jwhonce PTAL

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@vrothberg
Copy link
Member

@jwhonce @ashley-cui do you know what's going on?

@ashley-cui
Copy link
Member

I don't know exactly where the problem is but I tested on podman 2.1 and it's definitely a regression. I haven't looked into the old code enough to know where join is handled, but its different than table - table is table {{.Name}} whereas join is {{join .Config.Env "\n"}}, inside the template itself

@jwhonce jwhonce self-assigned this Jan 29, 2021
@jwhonce jwhonce added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Jan 29, 2021
@jwhonce
Copy link
Member

jwhonce commented Jan 29, 2021

@ashley-cui I know what the issue is and will fix it. Short explanation, we no longer define a set of template functions.

@jwhonce
Copy link
Member

jwhonce commented Jan 29, 2021

c/common updated with containers/common#426
podman will need to vendor in this update.

@jwhonce
Copy link
Member

jwhonce commented Feb 2, 2021

#9196 should have included fix in podman

@jwhonce jwhonce closed this as completed Feb 2, 2021
jwhonce added a commit to jwhonce/podman that referenced this issue Feb 9, 2021
For commands that use the golang template library directly add the
compatible template functions

Fixes containers#8773

Signed-off-by: Jhon Honce <[email protected]>
jwhonce added a commit to jwhonce/podman that referenced this issue Apr 2, 2021
For commands that use the golang template library directly add the
compatible template functions

[NO TESTS NEEDED]

Fixes containers#8773

Signed-off-by: Jhon Honce <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Apr 16, 2021
For commands that use the golang template library directly add the
compatible template functions

[NO TESTS NEEDED]

Fixes containers#8773

Signed-off-by: Jhon Honce <[email protected]>
jmguzik pushed a commit to jmguzik/podman that referenced this issue Apr 26, 2021
For commands that use the golang template library directly add the
compatible template functions

[NO TESTS NEEDED]

Fixes containers#8773

Signed-off-by: Jhon Honce <[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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/bug Categorizes issue or PR as related to a bug. 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 a pull request may close this issue.

7 participants