-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Bug 1318537 - Add warning when trying to import non-existing tag #8117
Conversation
LGTM |
@@ -347,6 +347,11 @@ func (o *ImportImageOptions) createImageImport() (*imageapi.ImageStream, *imagea | |||
if len(from) == 0 { | |||
from = stream.Spec.DockerImageRepository | |||
} | |||
// if the from is still empty this means there's no such tag defined | |||
// nor we can't create any from .spec.dockerImageRepository | |||
if len(from) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also tell the user to use the "tag" command if they want to do this.
@smarterclayton added tag command in the error message. |
// if the from is still empty this means there's no such tag defined | ||
// nor we can't create any from .spec.dockerImageRepository | ||
if len(from) == 0 { | ||
return nil, nil, fmt.Errorf("the tag %q does not exists on the image stream - use the 'tag' command to create it or choose a different tag to import", tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exist
instead of exists
. For second part, choose an existing tag to import or use the 'tag' command to create a new tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg, sorry for that exists - fixed.
LGTM [merge] |
[Test]ing while waiting on the merge queue |
Fixed the typo in tests |
Evaluated for origin test up to 6e84e1f |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/2330/) |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5381/) (Image: devenv-rhel7_3787) |
Flake #8039. |
Evaluated for origin merge up to 6e84e1f |
Merged by openshift-bot
Fixes Bug 1318537.
@smarterclayton ptal