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 up a number of misplace commands #2471

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

baude
Copy link
Member

@baude baude commented Feb 27, 2019

  • ps now on main command
  • sign is no longer on main commmand
  • ls, list no longer are valid main aliases for images
  • ls, list does work for podman image

Signed-off-by: baude [email protected]

* ps now on main command
* sign is no longer on main commmand
* ls, list no longer are valid main aliases for images
* ls, list does work for podman image

Signed-off-by: baude <[email protected]>
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: baude

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2019
@baude baude requested review from edsantiago and removed request for mrunalp and TomSweeneyRedHat February 27, 2019 18:43
@baude baude requested a review from rhatdan February 27, 2019 18:43
@@ -158,10 +158,9 @@ var (
psCommand cliconfig.PsValues
psDescription = "Prints out information about the containers"
_psCommand = &cobra.Command{
Use: "list",
Aliases: []string{"ls", "ps"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to remove 'ls' and 'list' aliases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, per @rhatdan

@@ -87,7 +87,7 @@ var (
imagesCommand cliconfig.ImagesValues
imagesDescription = "lists locally stored images."

_imagesCommand = &cobra.Command{
_imagesCommand = cobra.Command{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This surprised me: everywhere else, the convention is

    _xxxCommand = &cobra.Command{

It's even more jarring because of the corresponding change in main.go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is the black magic to get the subcommand image to honor images, ls, list but not honor ls, list on the main podman menu. Perhaps better put:

  • podman image ls should work
  • podman ls should not work

@@ -14,14 +14,14 @@ var (
Long: imageDescription,
},
}
_imagesSubCommand = _imagesCommand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually copy it? I'm wondering how we get two images commands with different aliases out of a simple equals

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, so we're doing actual values here, instead of pointers, and that forces the copy. Ok...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do not ... at least when the original was defined as a pointer. this was the only way it actually worked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it looks like Go automagically copies when it's a struct assigned by value, not reference.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a comment here like "Don't use pointer to force copy" so someone doesn't see this in a month and say "why is this different? I'm going to make this look like the others"

@TomSweeneyRedHat
Copy link
Member

Code tests well. However ubuntu test isn't happy atm.

@rhatdan
Copy link
Member

rhatdan commented Feb 27, 2019

This is a partial fix, now the podman commands match the man pages. But we still have issues with
podman image and podman container.

Lets merge this and then work on those.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2019
@openshift-merge-robot openshift-merge-robot merged commit 4e553cf into containers:master Feb 27, 2019
@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
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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.

7 participants