Commit e8489264 authored by Brendan Burns's avatar Brendan Burns

Addressed comments.

parent 4209bd48
...@@ -882,6 +882,9 @@ Examples: ...@@ -882,6 +882,9 @@ Examples:
$ kubectl run-container nginx --image=dockerfile/nginx --dry-run $ kubectl run-container nginx --image=dockerfile/nginx --dry-run
<just print the corresponding API objects, don't actually send them to the apiserver> <just print the corresponding API objects, don't actually send them to the apiserver>
$ kubectl run-container nginx --image=dockerfile/nginx --overrides='{ "apiVersion": "v1beta1", "desiredState": { ... } }'
<start a single instance of nginx, but overload the desired state with a partial set of values parsed from JSON
Usage: Usage:
``` ```
...@@ -913,7 +916,7 @@ Usage: ...@@ -913,7 +916,7 @@ Usage:
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests. --ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
-o, --output="": Output format: json|yaml|template|templatefile -o, --output="": Output format: json|yaml|template|templatefile
--output-version="": Output the formatted object with the given version (default api-version) --output-version="": Output the formatted object with the given version (default api-version)
--overrides="": An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object --overrides="": An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object. Requires that the object supply a valid apiVersion field.
-r, --replicas=1: Number of replicas to create for this container. Default 1 -r, --replicas=1: Number of replicas to create for this container. Default 1
-s, --server="": The address of the Kubernetes API server -s, --server="": The address of the Kubernetes API server
--stderrthreshold=2: logs at or above this threshold go to stderr --stderrthreshold=2: logs at or above this threshold go to stderr
......
...@@ -198,7 +198,7 @@ func Merge(dst runtime.Object, fragment, kind string) error { ...@@ -198,7 +198,7 @@ func Merge(dst runtime.Object, fragment, kind string) error {
} }
codec := runtime.CodecFor(api.Scheme, versionString) codec := runtime.CodecFor(api.Scheme, versionString)
intermediate.(map[string]interface{})["kind"] = kind dataMap["kind"] = kind
data, err := json.Marshal(intermediate) data, err := json.Marshal(intermediate)
if err != nil { if err != nil {
return err return err
......
...@@ -40,7 +40,10 @@ Examples: ...@@ -40,7 +40,10 @@ Examples:
<starts a replicated instance of nginx> <starts a replicated instance of nginx>
$ kubectl run-container nginx --image=dockerfile/nginx --dry-run $ kubectl run-container nginx --image=dockerfile/nginx --dry-run
<just print the corresponding API objects, don't actually send them to the apiserver>`, <just print the corresponding API objects, don't actually send them to the apiserver>
$ kubectl run-container nginx --image=dockerfile/nginx --overrides='{ "apiVersion": "v1beta1", "desiredState": { ... } }'
<start a single instance of nginx, but overload the desired state with a partial set of values parsed from JSON`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 { if len(args) != 1 {
usageError(cmd, "<name> is required for run") usageError(cmd, "<name> is required for run")
...@@ -84,6 +87,6 @@ Examples: ...@@ -84,6 +87,6 @@ Examples:
cmd.Flags().IntP("replicas", "r", 1, "Number of replicas to create for this container. Default 1") cmd.Flags().IntP("replicas", "r", 1, "Number of replicas to create for this container. Default 1")
cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, don't actually do anything") cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, don't actually do anything")
cmd.Flags().StringP("labels", "l", "", "Labels to apply to the pod(s) created by this call to run.") cmd.Flags().StringP("labels", "l", "", "Labels to apply to the pod(s) created by this call to run.")
cmd.Flags().String("overrides", "", "An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object") cmd.Flags().String("overrides", "", "An inline JSON override for the generated object. If this is non-empty, it is parsed used to override the generated object. Requires that the object supply a valid apiVersion field.")
return cmd return cmd
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment