-
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
Allow objects to request resolution, not just images #14795
Conversation
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.
I'm additionally missing test-cmd for the oc image-lookup
command itself.
pkg/cmd/cli/cmd/set/imagelookup.go
Outdated
namespace for any image that matches, regardless of whether the image stream has lookup | ||
enabled. | ||
|
||
$ %[1]s run mysql --image=myregistry:5000/test/mysql:v1 |
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.
Mind fixing the formatting here.
pkg/cmd/cli/cmd/set/imagelookup.go
Outdated
default: | ||
accessor, ok := ometa.GetAnnotationAccessor(info.Object) | ||
if !ok { | ||
fmt.Fprintf(w, "%s/%s\tUNKNOWN\n", info.Mapping.Resource, info.Name) |
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.
- Make this error message more readable,
UNKNOWN
is not helpful. - This method allows returning errors, but you're not actually using it anywhere, it would be good to either gather errors in a list and return aggregate, or return at any error. I'd personally went with the former.
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.
This isn't an error message, this is indicating that the provided object doesn't support the annotation. We don't display errors in list views usually, we display something simple. Effectively, this is "unsupported".
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.
Having resource/X is not supported
seems more understandable in that case.
o.Expect(err).NotTo(o.HaveOccurred()) | ||
|
||
if pod.Spec.Containers[0].Image != tag.Image.DockerImageReference { | ||
g.Skip("default image resolution is not configured, can't verify pod resolution") |
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.
This worries me a bit, why do we want to have this skip?
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.
Because admins can turn off image resolution.
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.
True, but we should make sure we have them on in tests. If we do silent skips, we fail to know when this will break. Don't we?
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 can't really split the difference. An upgraded cluster isn't required to have these, so extended tests being skipped is irritating but not essential.
And you're missing updated completions. |
7ed26b7
to
79f66e9
Compare
A lot of times, you want to be able to reuse a bit of config that works fine elsewhere. By adding the `alpha.image.policy.openshift.io/resolve-names` annotation with value `*` to the object you can request that resolution attempt to match all image references to an image stream tag in the current namespace, regardless of their own policy. This makes it easy to transition to looking up image stream tags by name. Extend `oc set image-lookup` to accept `deploy/foo` and to be able to list and display non image stream resources.
[test]
…On Mon, Jun 26, 2017 at 8:07 PM, OpenShift Bot ***@***.***> wrote:
continuous-integration/openshift-jenkins/test FAILURE (
https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2646/)
(Base Commit: d007fa3
<d007fa3>)
(PR Branch Commit: 7ca6090
<7ca6090>
)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14795 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p75wd_FzarLeuSi3GH5m4yKTUPeMks5sIEfJgaJpZM4OAcZb>
.
|
Updates made, tests added.
|
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.
One nit, but this LGTM.
os::cmd::expect_success_and_text "oc set image-lookup secrets --list" "false" | ||
|
||
# Clear resources | ||
os::cmd::expect_success "oc delete deploy,dc,rs,rc,pods --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.
You're not creating DC, so no need to remove it.
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.
Ah. I may come back and add one in a follow on.
Flake #14043 [merge] |
[test] |
Evaluated for origin test up to 7ca6090 |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2730/) (Base Commit: a67ac87) (PR Branch Commit: 7ca6090) |
Flake #14043 [merge] |
Evaluated for origin merge up to 7ca6090 |
continuous-integration/openshift-jenkins/merge FAILURE (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1161/) (Base Commit: 6bbad88) (PR Branch Commit: 7ca6090) |
A lot of times, you want to be able to reuse a bit of config that works
fine elsewhere. By adding the
alpha.image.policy.openshift.io/resolve-names
annotation with value
*
to the object you can request that resolutionattempt to match all image references to an image stream tag in the
current namespace, regardless of their own policy. This makes it easy to
transition to looking up image stream tags by name.
Extend
oc set image-lookup
to acceptdeploy/foo
and to be able tolist and display non image stream resources.
@soltysh @mfojtik [test] this is somewhat last minute, but after using this
more I also wanted to be able to easily flip from using a config template
someone gave me to an image I built in the current namespace, with minimal
pain: