-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Allow new-app to create test deployments #7010
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ var ( | |
| projectColumns = []string{"NAME", "DISPLAY NAME", "STATUS"} | ||
| routeColumns = []string{"NAME", "HOST/PORT", "PATH", "SERVICE", "LABELS", "INSECURE POLICY", "TLS TERMINATION"} | ||
| deploymentColumns = []string{"NAME", "STATUS", "CAUSE"} | ||
| deploymentConfigColumns = []string{"NAME", "TRIGGERS", "LATEST"} | ||
| deploymentConfigColumns = []string{"NAME", "REVISION", "REPLICAS", "TRIGGERED BY"} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like these more, sup
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also not showing replicas so far has been really disturbing. We need though to show current alongside desired, showing only desired is misleading. We also need to make use of -o wide and put images, containers, and the selector under it. Preparing a pull for that.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have current on status now? On Wed, Feb 3, 2016 at 8:00 PM, Michail Kargakis notifications@github.com
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately no, it's #6233 |
||
| templateColumns = []string{"NAME", "DESCRIPTION", "PARAMETERS", "OBJECTS"} | ||
| policyColumns = []string{"NAME", "ROLES", "LAST MODIFIED"} | ||
| policyBindingColumns = []string{"NAME", "ROLE BINDINGS", "LAST MODIFIED"} | ||
|
|
@@ -452,18 +452,54 @@ func printRouteList(routeList *routeapi.RouteList, w io.Writer, opts kctl.PrintO | |
| } | ||
|
|
||
| func printDeploymentConfig(dc *deployapi.DeploymentConfig, w io.Writer, opts kctl.PrintOptions) error { | ||
| var scale string | ||
| if dc.Spec.Test { | ||
| scale = fmt.Sprintf("%d (during test)", dc.Spec.Replicas) | ||
| } else { | ||
| scale = fmt.Sprintf("%d", dc.Spec.Replicas) | ||
| } | ||
|
|
||
| containers := sets.NewString() | ||
| if dc.Spec.Template != nil { | ||
| for _, c := range dc.Spec.Template.Spec.Containers { | ||
| containers.Insert(c.Name) | ||
| } | ||
| } | ||
| //names := containers.List() | ||
| referencedContainers := sets.NewString() | ||
|
|
||
| triggers := sets.String{} | ||
| for _, trigger := range dc.Spec.Triggers { | ||
| triggers.Insert(string(trigger.Type)) | ||
| switch t := trigger.Type; t { | ||
| case deployapi.DeploymentTriggerOnConfigChange: | ||
| triggers.Insert("config") | ||
| case deployapi.DeploymentTriggerOnImageChange: | ||
| if p := trigger.ImageChangeParams; p != nil && p.Automatic { | ||
| var prefix string | ||
| if len(containers) != 1 && !containers.HasAll(p.ContainerNames...) { | ||
| sort.Sort(sort.StringSlice(p.ContainerNames)) | ||
| prefix = strings.Join(p.ContainerNames, ",") + ":" | ||
| } | ||
| referencedContainers.Insert(p.ContainerNames...) | ||
| switch p.From.Kind { | ||
| case "ImageStreamTag": | ||
| triggers.Insert(fmt.Sprintf("image(%s%s)", prefix, p.From.Name)) | ||
| default: | ||
| triggers.Insert(fmt.Sprintf("%s(%s%s)", p.From.Kind, prefix, p.From.Name)) | ||
| } | ||
| } | ||
| default: | ||
| triggers.Insert(string(t)) | ||
| } | ||
| } | ||
| tStr := strings.Join(triggers.List(), ", ") | ||
| trigger := strings.Join(triggers.List(), ",") | ||
|
|
||
| if opts.WithNamespace { | ||
| if _, err := fmt.Fprintf(w, "%s\t", dc.Namespace); err != nil { | ||
| return err | ||
| } | ||
| } | ||
| _, err := fmt.Fprintf(w, "%s\t%s\t%v\n", dc.Name, tStr, dc.Status.LatestVersion) | ||
| _, err := fmt.Fprintf(w, "%s\t%v\t%s\t%s\n", dc.Name, dc.Status.LatestVersion, scale, trigger) | ||
| return err | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,6 +226,7 @@ items: | |
| terminationMessagePath: /dev/termination-log | ||
| dnsPolicy: ClusterFirst | ||
| restartPolicy: Always | ||
| test: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure this doesn't interfere with other tests
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't |
||
| triggers: | ||
| - type: ConfigChange | ||
| status: | ||
|
|
||
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.
How does one indicate, on a test DC, what post-test tagging to perform?
and, given that, does it make sense to allow someone to specify that tag when they invoke new-app?
$ oc new-app myappIST --as-test --push-tag myProdAppIST
or some such syntax? Since that's the 90% use case for this (stitching together a pipeline)?
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.
It might make sense - it's one more set of arguments. In our hypothesized split, it definitely belongs on
oc deploy/oc runThere 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.
Ok, here's my straw man:
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.
so you're proposing you cannot set it as part of invoking new-app itself? Given the primary use case for creating a test deployment is so it can tag an image when it passes, it seems like i should be able to do that in a single command.
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.
Not proposing that, just saying I haven't sorted it out yet and would like to see what the actual "set hooks" command looks like before we do the simpler thing.
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 guess i'm ok w/ that strawman.