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 1327108 - Updated error information when trying to import ImageStream pointing to a different one #9021
Conversation
// disallow re-importing anything other than DockerImage | ||
if existing.From != nil && existing.From.Kind != "DockerImage" { | ||
return nil, nil, fmt.Errorf("tag %q points to existing %s %q, it cannot be re-imported", tag, existing.From.Kind, existing.From.Name) | ||
} | ||
// disallow changing an existing tag | ||
if existing.From == nil || existing.From.Kind != "DockerImage" { |
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.
It seems like the second part of the expression (beginning with ||
) is no longer needed.
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.
Is there a need for the second error message at all?
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.
Good catch - fixed. And yes it is, see the attached bug.
// disallow changing an existing tag | ||
if existing.From == nil || existing.From.Kind != "DockerImage" { | ||
if existing.From == nil { | ||
return nil, nil, fmt.Errorf("tag %q already exists - you must use the 'tag' command if you want to change the source to %q", tag, from) |
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.
Quoting the error message from the mentioned bz:
error: tag "latest" already exists - you must use the 'tag' command if you want to change the source to ""
Since the from
may be unset either strip the to %q
suffix or make it appear depending on from
.
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.
Yeah, but we lack information why you can't import it. One assumes if the tag is there it should be importable, which is not true for kind != DockerImage
.
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.
We agreed to address the problem upon next PRs that I'll be submitting when fixing import-image.
One suggestion. LGTM |
ImageStream pointing to a different one
Rebase and merging upon previous approval. [merge] |
Flake #9203. [merge] |
[merge] yum flake |
Flake #9338. |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4886/) (Image: devenv-rhel7_4380) |
yum again... [merge] |
Evaluated for origin merge up to 4ab49ca |
@smarterclayton @miminar ptal it's addressing the issue https://bugzilla.redhat.com/show_bug.cgi?id=1327108