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
add oc create dc #8712
add oc create dc #8712
Conversation
Can't you use |
Counting on the output of an intent-like command like |
That's the concept of pinning down to a generator. I haven't seen anyone complaining about the current state with respect to creating deployments (not saying that it's optimal). Also, why do you need a dc for your test? Can't you run a pod or rc? Will you test deployments? @fabianofranz @smarterclayton what's your opinion on this? Do we want to support duplicate commands? We agreed that we don't want to continue adding to |
These aren't duplicate commands. One is The other is |
cmd := &cobra.Command{ | ||
Use: name + " NAME --image=IMAGE -- [COMMAND] [args...]", | ||
Short: "Create deployment config with default options that uses a given image.", | ||
Long: policyBindingLong, |
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.
deploymentConfigLong
With only one flag and lots of defaulting, are we sure this is going to be useful? Maybe it would be better to have a "default" target on the generator? |
There are no generators for origin resources. Turns out that most of the time you're starting with this, you don't care about the vast majority of things we can set. Even just getting the yaml skeleton so |
comments addressed. |
o := &CreateDeploymentConfigOptions{Out: out} | ||
|
||
cmd := &cobra.Command{ | ||
Use: name + " NAME --image=IMAGE -- [COMMAND] [args...]", |
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 don't see any special handling of dashes. You may want to have a look at kubernetes/kubernetes#13917
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 don't see any special handling of dashes. You may want to have a look at kubernetes/kubernetes#13917
Added the check to make sure that you only have one arg before the dash.
Please concretely explain why this is not oc run. |
I know that I want a DC. I will always want a DC. I will never want this command to decide to make a job or a pod or an RC or a D or any of the other things that have broken what it does in the past. I the simplest possible command with options that I can understand that always behave predictably to get me started without having to know yaml and allow easy composition with This is exactly the command that I wanted to start the nginx stuff because I knew what I wanted and couldn't figure out how to use |
If the args for your command look like run, you should be using run. If you don't trust run, that's reasonable, but the answer is to use run and we should fix your worries. I do not want to add a create deploymentconfig command that offers nothing outside of run. We already have plans to add something that is focused on deploying images, I'd prefer not to add a third way. |
Unless we undo 90% of what |
So I can find this in the future, all you need to do is |
Such snark. As we talked about in person I'm ok with this if you can describe the boundaries clearly in doc about why these exist, and what the limit is on what people can add to them (probably in kubectl conventions upstream). |
Or: alias 'oc-create-dc'="oc run ', which is the same. |
DeploymentConfigRecommendedName = "deploymentconfig" | ||
|
||
deploymentConfigLong = ` | ||
Create a deployment config that uses a given image.` |
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.
Describe what deployment configs are and why I want them. Crib from the API doc if necessary.
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.
Describe what deployment configs are and why I want them. Crib from the API doc if necessary.
added.
Upstream pull got agreement in principle for I think I got all the comments. |
|
||
func (o *CreateDeploymentConfigOptions) Complete(cmd *cobra.Command, f *clientcmd.Factory, args []string) error { | ||
argsLenAtDash := cmd.ArgsLenAtDash() | ||
if argsLenAtDash != 1 { |
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.
note to self, handle the case of no dashes
any other comments? |
lgtm [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5827/) (Image: devenv-rhel7_4118) |
Evaluated for origin merge up to 0bde6e5 |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to 0bde6e5 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3629/) |
LGTM, pretty much what I meant here. |
Adds
oc create dc
so I can dooc create dc my-nginx --image=nginx -- nginx -t -c /path/to/mynginx.conf
so I can easily write the service serving cert test for clayton.@Kargakis @stevekuznetsov