oc: Use default resources where it makes sense#4947
oc: Use default resources where it makes sense#4947openshift-bot merged 1 commit intoopenshift:masterfrom 0xmichalis:default-resources-in-commands
Conversation
pkg/cmd/cli/cmd/deploy.go
Outdated
|
This command is requiring resource/name format: https://github.com/openshift/origin/blob/master/pkg/cmd/cli/secrets/add_secret_to_obj.go |
For two args, no less |
|
[test] |
|
@deads2k jenkins is green, merge at your will |
|
Are there tests to make sure prior invocations still work correctly? |
|
|
I agree it should, just not sure it does :) |
I've updated the first post with more details about and I've also updated test-cmd to test all cases. |
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
This seems like something that should be handled by resource builder?
There was a problem hiding this comment.
I am not using the resource builder here because it would try to get the buildConfig (which we are not interested in) in order to start the build. Instead, I think using the RESTMapper to resolve the resource type is enough.
There was a problem hiding this comment.
It makes me believe that what you are representing here is a common pattern
that should be abstracted either into resource.Builder (but without the
fetch) or as supporting utility code in the cmd packages.
On Oct 11, 2015, at 3:38 PM, Michail Kargakis notifications@github.com
wrote:
In pkg/cmd/cli/cmd/startbuild.go
#4947 (comment):
name := buildName
isBuild := true
- if len(name) == 0 {
name = args[0]- if len(name) == 0 && len(args[0]) > 0 {
parts := strings.Split(args[0], "/")
I am not using the resource builder here because it would try to get the
buildConfig (which we are not interested in) in order to start the build.
Instead, I think using the RESTMapper to resolve the resource type is
enough.
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/4947/files#r41714535.
There was a problem hiding this comment.
Added an utility under origin/pkg/cmd/util to handle this.
|
re[test] |
|
go stdlib race rere[test] |
|
Tagging more eyes: @ironcladlou about deploy |
There was a problem hiding this comment.
I think what you really want is a way to get a canonical resource representation. Something where you get "imagestreamtag" back for "istag", "istags", "imagestreamtags" in any case. If multiple resources deal in the same kind, this breaks because "notAnIsTag/foo" would match.
I asked @smarterclayton if he knew whether it existed, he said he'd look for it/make it.
|
[test] |
|
[test] |
|
Test flake in #5410 On Sat, Oct 24, 2015 at 6:00 PM, OpenShift Bot notifications@github.com
|
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
don't you need to make sure you got back a non-empty name? I would do so after this block, to catch the case where len(args[0]) == 0
|
one question on fromRepo, fromFile, etc interaction from @smarterclayton, then lgtm |
|
we're safe. On Tue, Oct 27, 2015 at 4:32 PM, Jordan Liggitt notifications@github.com
|
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
move this check outside the if block to catch cases where len(name)==0, but len(args[0]) == 0, for example
|
Evaluated for origin test up to e30dccd |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6430/) |
|
LGTM, ready to merge? |
|
Lets do it |
|
[merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3879/) (Image: devenv-rhel7_2614) |
|
Evaluated for origin merge up to e30dccd |
Merged by openshift-bot
Commands I have defaulted using the builder/RESTMapper in this PR:
(Was using both syntaxes before, now achieves it via the resource builder.)
(Was using both syntaxes before, now achieves it via the RESTMapper.)
(Was using only NAME syntax, now uses bc/NAME too.)
(Was using only TYPE/NAME syntax, now uses NAME too.)
(Was using only NAME syntax, now uses build/NAME too.)
@smarterclayton @fabianofranz
Fixes #4781
Fixes #1995