Adds a flag to allow skipping config writes when creating a project#10057
Adds a flag to allow skipping config writes when creating a project#10057openshift-bot merged 1 commit intoopenshift:masterfrom
Conversation
pkg/cmd/cli/cmd/request_project.go
Outdated
| } | ||
| } | ||
|
|
||
| fmt.Fprintf(o.Out, ` |
There was a problem hiding this comment.
Looks like this is unconditional. Wouldn't it be kind of weird to output this to someone whose config is already updated and they're using this project?
62cd3b6 to
4002035
Compare
|
re[test] |
4002035 to
2b38120
Compare
pkg/cmd/cli/cmd/request_project.go
Outdated
| o.ProjectOptions.ProjectOnly = true | ||
| o.ProjectOptions.SkipAccessValidation = true | ||
| if !o.SkipConfigWrite { | ||
| if o.ProjectOptions != nil { |
There was a problem hiding this comment.
reading more carefully, couldn't SkipConfigWrite cause us to avoid creating the ProjectOptions in complete, which would prevent us from running RunProject, which would prevent the config write?
If you did that, then our nesting here stays the same, the existing Fprintf shoudl already have been under the existing if block, and you're just adding an else saying you can switch if you want?
if projectoptions != nil{
// do existing working
printf "you can add applications"
} else{
printf "to switch to this project"
}There was a problem hiding this comment.
I think that makes sense. I'm using ProjectOptions to get the server host and be able to display ...created on server https://foo, but I think it can be taken from o.Client. Let me give it a try.
There was a problem hiding this comment.
@deads2k Done. I still have to take a clientConfig to get the host, but definitely looks better.
|
@juanvallejo want a shot at it? |
d7a1b38 to
42f14ee
Compare
|
@deads2k Sure, I'll go ahead and assign myself to review |
ac6bccd to
8e16cc8
Compare
|
lgtm, is the extra tab in 8e16cc8#diff-87101210f21d81738e8b13078e66af90R137 intentional? EDIT: Ah, I see why now, missed the fact that it was part of the |
|
lgtm [merge] |
8e16cc8 to
013e883
Compare
|
flake, re[merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7436/) (Image: devenv-rhel7_4738) |
|
re[test] |
f4f23f3 to
426f8cf
Compare
426f8cf to
6ef4c5f
Compare
|
Evaluated for origin test up to 6ef4c5f |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/7418/) |
|
Evaluated for origin merge up to 6ef4c5f |
Fixes #9979.
By using the
--skip-config-writeflag to skip the kubeconfig load and write,oc new-projectwill only call the REST API to create the project and exit. The command runs much faster, which is useful when creating multiple projects in a batch.