-
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
Adds a flag to allow skipping config writes when creating a project #10057
Conversation
} | ||
} | ||
|
||
fmt.Fprintf(o.Out, ` |
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.
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?
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.
oops, fixed.
62cd3b6
to
4002035
Compare
re[test] |
4002035
to
2b38120
Compare
o.ProjectOptions.ProjectOnly = true | ||
o.ProjectOptions.SkipAccessValidation = true | ||
if !o.SkipConfigWrite { | ||
if o.ProjectOptions != nil { |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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-write
flag to skip the kubeconfig load and write,oc new-project
will 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.