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

Refactor report package to be more compatible #831

Merged
merged 1 commit into from
Nov 19, 2021

Conversation

jwhonce
Copy link
Member

@jwhonce jwhonce commented Nov 18, 2021

  • Add additional replacer for ('', 'n') -> "\n"
  • New type Formatter embeds Template and writer/tabwriter handling
  • tabwriter.Init() is exposed to allow updating the tabwriter settings

Note: If template origin is OriginPodman or has "table" keyword prefix
output will be filtered through tabwriter. Otherwise, output will be
rendered using given writer.

Note: Once all podman commands have been updated a follow on PR will
remove the old report.Template and report.Writer code.

See containers/podman#10974

Signed-off-by: Jhon Honce [email protected]

@vrothberg
Copy link
Member

Is there a sibling PR against Podman with these changes? Just to make sure we don't regress in some corner case.

@rhatdan
Copy link
Member

rhatdan commented Nov 18, 2021

Yes I think it would be best to have a Podman WIP with this PR included.

* Add additional replacer for ('\', 'n') -> "\n"
* New type Formatter embeds Template and writer/tabwriter handling
* tabwriter.Init() is exposed to allow updating the tabwriter settings

Note: If template origin is OriginPodman or has "table" keyword prefix
output will be filtered through tabwriter. Otherwise, output will be
rendered using given writer.

Note: Once all podman commands have been updated a follow on PR will
remove the old report.Template and report.Writer code.

See containers/podman#10974

Signed-off-by: Jhon Honce <[email protected]>
@jwhonce
Copy link
Member Author

jwhonce commented Nov 19, 2021

@vrothberg @rhatdan Yup, working the corner cases and tests now. This PR is "safe" to merge before changes to podman. I plan on several PR's for podman since it will require a refactor of all cmd/podman/*

@jwhonce jwhonce changed the title [WIP] Refactor report package to be more compatible Refactor report package to be more compatible Nov 19, 2021
@rhatdan
Copy link
Member

rhatdan commented Nov 19, 2021

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 19, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jwhonce, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 87f30c7 into containers:main Nov 19, 2021
jwhonce added a commit to jwhonce/podman that referenced this pull request Dec 1, 2021
Leverage new report.Formatter allowing better compatibility from
podman command output.

See containers#10974
See containers#12455

Depends on containers/common#831

Signed-off-by: Jhon Honce <[email protected]>
jwhonce added a commit to jwhonce/podman that referenced this pull request Dec 3, 2021
[NO NEW TESTS NEEDED]

Support better compatibility output for podman system commands

* Format and content of output from podman version changed to
  be more compatible

See containers#10974
Depends on containers/common#831

Signed-off-by: Jhon Honce <[email protected]>
jwhonce added a commit to jwhonce/podman that referenced this pull request Dec 6, 2021
[NO NEW TESTS NEEDED]

Support better compatibility output for podman pods commands

See containers#10974
Depends on containers/common#831

Signed-off-by: Jhon Honce <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants