Skip to content

Bug 1312230 - fix image import command to reflect the actual status - #10847

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
soltysh:bug1312230
Sep 30, 2016
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
soltysh:bug1312230

Conversation

@soltysh

@soltysh soltysh commented Sep 8, 2016

Copy link
Copy Markdown
Contributor

Currently we always return The import completed successfully no matter what actually happened. This PR small check to modify slightly this information to better reflect the actual status.

Fixes bug 1312230.

@openshift/cli-review ptal

Comment thread pkg/cmd/cli/cmd/importimage.go Outdated
default:
fmt.Fprint(o.out, "The import completed successfully.\n\n")
if wasError(result) {
fmt.Fprint(o.out, "The import did not complete successfully, please check below for details.\n\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hm, we should be outputting this through stderr

@soltysh

soltysh commented Sep 9, 2016

Copy link
Copy Markdown
Contributor Author

Comments addressed.

Comment thread pkg/cmd/cli/cmd/importimage.go Outdated
default:
fmt.Fprint(o.out, "The import completed successfully.\n\n")
if wasError(result) {
fmt.Fprint(o.errout, "The import did not complete successfully, please check below for details.\n\n")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't say "successfully" if there was an error. Also, we try to exit with "error: ", so I don't think this line would be correct. It would be better to actually print out the error condition directly to the user water than print the describe.

@soltysh

soltysh commented Sep 20, 2016

Copy link
Copy Markdown
Contributor Author

@smarterclayton updated, current output:

$ oc import-image pyfake 
The import completed with following errors:
- latest: you may not have access to the Docker image "wsun/non-existen-image".

Name:           pyfake
Namespace:      test
...

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2016
@soltysh

soltysh commented Sep 26, 2016

Copy link
Copy Markdown
Contributor Author

Rebased @smarterclayton || @openshift/cli-review ptal

@fabianofranz

Copy link
Copy Markdown
Contributor

LGTM

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 26, 2016
@openshift-bot

Copy link
Copy Markdown
Contributor

[Test]ing while waiting on the merge queue

@mfojtik

mfojtik commented Sep 27, 2016

Copy link
Copy Markdown
Contributor

LGTM, good stuff @soltysh

@soltysh

soltysh commented Sep 27, 2016

Copy link
Copy Markdown
Contributor Author

LGTM, good stuff @soltysh

I'm just fixing bugs 😉

@smarterclayton

Copy link
Copy Markdown
Contributor

Errors should print with an "error: " prefix (and print last) if you encounter them.

@smarterclayton

Copy link
Copy Markdown
Contributor

Removing merge, it doesn't quite explain that errors occurred in a way that jumps out at the user.

@smarterclayton

Copy link
Copy Markdown
Contributor

Basically from the output it's not obvious that the action actually failed. Either:

one error:

error: Import of tag failed: <error>

multiple errors:

error: Import of tag failed:
* ...
* ...

or errors plus output:

Import partially successful:

Describe output:

error: Import of tag X failed ...

@soltysh

soltysh commented Sep 29, 2016

Copy link
Copy Markdown
Contributor Author

@smarterclayton updated, I dropped printing errors, since we already do that next to every tag (sic!), so I've just changed the successful message to one with information there was errors. Here's the current output:

$ oc import-image pyfake 
The import completed with errors.

Name:           pyfake
Namespace:      test
Created:        7 minutes ago
Labels:         <none>
Annotations:        openshift.io/image.dockerRepositoryCheck=2016-09-29T10:40:23Z
Docker Pull Spec:   172.30.54.29:5000/test/pyfake
Unique Images:      0
Tags:           2

latest
  tagged from wsun/non-existen-image

  ! error: Import failed (Unauthorized): you may not have access to the Docker image "wsun/non-existen-image"
      7 minutes ago

3.3
  tagged from wsun/pythonlol-33-centos

  wsun tests

  ! error: Import failed (Unauthorized): you may not have access to the Docker image "wsun/pythonlol-33-centos"
      7 minutes ago

Is it more to your liking?

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 584e1cb

@openshift-bot

Copy link
Copy Markdown
Contributor

1 similar comment
@openshift-bot

Copy link
Copy Markdown
Contributor

@smarterclayton

Copy link
Copy Markdown
Contributor

Yes that's excellent.

On Thu, Sep 29, 2016 at 8:12 AM, OpenShift Bot [email protected]
wrote:

continuous-integration/openshift-jenkins/test SUCCESS (
https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9477/)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#10847 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG_p7vv2eVkjkljEmveES3Yz8KuRTNeks5qu6swgaJpZM4J36t1
.

@soltysh

soltysh commented Sep 29, 2016

Copy link
Copy Markdown
Contributor Author

[merge]

upon approval

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to 584e1cb

@openshift-bot

openshift-bot commented Sep 30, 2016 •

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9530/) (Image: devenv-rhel7_5104)

@openshift-bot
openshift-bot merged commit fc46190 into openshift:master Sep 30, 2016
@soltysh
soltysh deleted the bug1312230 branch September 30, 2016 07:55
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.

6 participants