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

Fix go template parsing with "\n" in it #15673

Merged
merged 15 commits into from
Sep 13, 2022

Commits on Sep 13, 2022

  1. podman auto-update: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    65e78d9 View commit details
    Browse the repository at this point in the history
  2. podman machine ls: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    a687949 View commit details
    Browse the repository at this point in the history
  3. podman machine inspect: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    Also fix a bug where a invlaid template would not cause a exit code > 0,
    see the added test case.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    20eccfc View commit details
    Browse the repository at this point in the history
  4. podman volume ls: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    Also fixa bug since the table format is expected to print headers as
    well.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    90634d5 View commit details
    Browse the repository at this point in the history
  5. podman network ls: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    1463898 View commit details
    Browse the repository at this point in the history
  6. podman secret ls: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    f5e13de View commit details
    Browse the repository at this point in the history
  7. podman secret inspect: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    377599f View commit details
    Browse the repository at this point in the history
  8. podman inspect: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output, we can add a new test for the
    newline bug when the common PR is vendored in.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    00240a0 View commit details
    Browse the repository at this point in the history
  9. podman inspect return exit code > 0 on print error

    Unlikely to happen but when there is an error printing the data to
    stdout (either as json or go template) we should not just log it and
    exit with 0. Instead return a proper error and exit with 125.
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    43f7bdf View commit details
    Browse the repository at this point in the history
  10. tests for 15673

    Signed-off-by: Ed Santiago <santiago@redhat.com>
    edsantiago authored and Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    1acebdd View commit details
    Browse the repository at this point in the history
  11. podman info: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    e5389e9 View commit details
    Browse the repository at this point in the history
  12. podman machine info: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    0c21dcf View commit details
    Browse the repository at this point in the history
  13. podman version: use report.Formatter over Template

    Currently the podman command --format output code uses a mix of
    report.Formatter and report.Template.
    
    I patched report.Formatter to correctly handle newlines[1]. Since we
    cannot fix this with report.Template we have to migrate all users to
    report.Formatter. This ensures consistent behavior for all commands.
    
    This change does not change the output.
    
    [1] containers/common#1146
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    7f8e99d View commit details
    Browse the repository at this point in the history
  14. enable podman pod inspect --format test

    Now that commit d10e77e is merged, it will reuse the same template
    logic as inspect and therefore should just work.
    
    Also remove the FIXME from eds test.
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    908458d View commit details
    Browse the repository at this point in the history
  15. rework --format system test

    This version does a much better job of error reporting and also catches
    more commands.
    
    Changes from edsantiago.
    
    Signed-off-by: Paul Holzinger <pholzing@redhat.com>
    Luap99 committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    9d41b95 View commit details
    Browse the repository at this point in the history