Bug 1855983 - {{range $e = split .Repository "/"}}{{end}} in podman go template fails
Summary: {{range $e = split .Repository "/"}}{{end}} in podman go template fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: podman
Version: 34
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-11 14:22 UTC by tomi ollila
Modified: 2021-08-26 21:08 UTC (History)
10 users (show)

Fixed In Version: podman-3.3.0-1.fc34
Clone Of:
Environment:
Last Closed: 2021-08-26 21:08:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description tomi ollila 2020-07-11 14:22:11 UTC
Description of problem:

executing
podman images --format '{{.ID}} {{printf "%12.12s %8s" .CreatedSince .Size}} {{$e:=""}}{{range $e = split .Repository "/"}}{{end}}{{$e}}:{{.Tag}}'

crashes with core dump


Version-Release number of selected component (if applicable):

$ uname -a 
Linux localhost.localdomain 5.7.7-200.fc32.x86_64 #1 SMP Wed Jul 1 19:53:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

$ podman version
Version:      2.0.2
API Version:  1
Go Version:   go1.14.3
Built:        Thu Jan  1 02:00:00 1970
OS/Arch:      linux/amd64


How reproducible:

crashes always


Steps to Reproduce:

1. execute podman images --format '{{.ID}} {{printf "%12.12s %8s" .CreatedSince .Size}} {{$e:=""}}{{range $e = split .Repository "/"}}{{end}}{{$e}}:{{.Tag}}'


Actual results:

...
zsh: abort (core dumped)  podman images --format 


Expected results:

831691599b88    3 weeks ago     223 MB   centos:8
2a8d315e6208    8 weeks ago     208 MB   fedora:32
a3282b72a167   3 months ago    76.2 MB   ubuntu:20.04
08d05d1d5859   8 months ago     212 MB   centos:7.7.1908
48650444e419   16 months ag     202 MB   centos:6.10


Additional info:

Worked on Fedora 32 with podman version
    Version:            1.9.3
    RemoteAPI Version:  1
    Go Version:         go1.14.2
    OS/Arch:            linux/amd64


I've seen this 'split' not work on some ubuntu 19.10 environments w/ some
podman installations (the "opensuse" version) -- withouth crashing though),
but on fedora machines the podman images command line has always worked
('.CreatedSince', used to be '.Created' IIRC, but that is kinda irrelevant here)

Comment 1 tomi ollila 2020-08-30 18:19:18 UTC
This no longer crashes, that was fixed in some podman 2.0.x version.

Now podman just outputs message:

    Error: template: list:1: function "split" not defined

(and returns -1 to the parent process as I get error message "zsh: exit 125   podman images --format")


I am fine to close this ticket, if I get some understanding why function 'split' used to work in 
previous podman versions (up to 1.9...) and it is no longer...

I am also interested what functions are supported now (in addition to printf), if any (tried to find
docs, tried to understand code, with no luck)

Comment 2 Daniel Walsh 2020-09-15 19:35:22 UTC
Does this command work on Docker?

Comment 3 tomi ollila 2020-09-15 19:57:56 UTC
I'll test shortly on systems I find docker (still) available, some mine, some friends/colleaques...

Comment 4 tomi ollila 2020-09-16 07:20:44 UTC
It works...:


macOS Catalina 10.15.4% docker --version

Docker version 19.03.12, build 48a66213fe


macOS Catalina 10.15.4% docker images --format='{{$e:=""}}{{range $e = split .Repository "/"}}{{end}}{{$e}}:{{.Tag}}'

container-image:latest


macOS Catalina 10.15.4% docker images

REPOSITORY                                TAG                 IMAGE ID            CREATED             SIZE

hqxsr-cmmaven2:5000/container-image       latest              18d4b56854a2        2 weeks ago         1.46GB

Comment 5 Daniel Walsh 2021-01-28 12:17:29 UTC
Jon could you take a look at this bug?

Comment 6 Fedora Program Management 2021-04-29 17:10:46 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 tomi ollila 2021-05-01 20:37:12 UTC
Updated (Fedora) version from '32' to '34' in this bug report

The problem still persists, and (IIRC) this is "upstream bugzilla" for this software


fedora34$ podman --version
podman version 3.1.2

fedora34$ podman images --format '{{.ID}} {{printf "%12.12s %8s" .CreatedSince .Size}} {{$e:=""}}{{range $e = split .Repository "/"}}{{end}}{{$e}}:{{.Tag}}'
Error: template: list:1: function "split" not defined
zsh: exit 125   podman images --format

Comment 9 Tom Sweeney 2021-06-23 18:30:39 UTC
As noted by Jhon, fixed in the PRs noted in https://bugzilla.redhat.com/show_bug.cgi?id=1855983#c8.  This will be delivered in Podman 3.3 which is slated for RHEL 8.5

Assigning to Jindrich for any Packaging/BZ needs.

Comment 10 Fedora Update System 2021-08-05 18:04:01 UTC
FEDORA-2021-d70c53ec97 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-d70c53ec97

Comment 11 Fedora Update System 2021-08-07 14:11:04 UTC
FEDORA-2021-d70c53ec97 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-d70c53ec97`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-d70c53ec97

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 tomi ollila 2021-08-12 09:34:58 UTC
podman images --format='{{$e:=""}}{{range $e = split .Repository "/"}}{{end}}{{$e}}:{{.Tag}}'

worked for me as expected, with

podman-3.3.0-0.2.rc1.fc34.x86_64

Comment 13 tomi ollila 2021-08-12 09:48:43 UTC
The change is interesting -- does that mean there was real bug which this attempt revealed,
instead of a feature which happened to be there as a side effect?

Comment 14 Tom Sweeney 2021-08-16 14:45:11 UTC
@jhonce Do you have an answer to Tomi's question in https://bugzilla.redhat.com/show_bug.cgi?id=1855983#c13

Comment 15 Jhon Honce 2021-08-16 17:10:26 UTC
As issues and bugs are reported we work on our docker compatibility. There were changes in some podman sub-commands where they were not using our containers/common report package. That could explain this change.

Comment 16 Fedora Update System 2021-08-17 01:09:11 UTC
FEDORA-2021-94cbb4fa81 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-94cbb4fa81`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-94cbb4fa81

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2021-08-20 01:26:09 UTC
FEDORA-2021-140dfde78f has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-140dfde78f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-140dfde78f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2021-08-21 01:16:16 UTC
FEDORA-2021-7ce1dbeb75 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-7ce1dbeb75`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-7ce1dbeb75

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2021-08-26 21:08:03 UTC
FEDORA-2021-7ce1dbeb75 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.