Browse code

Fixed an error description of func, and deleted a redundant error check

update

update

Yanqiang Miao authored on 2016/09/02 12:06:29
Showing 1 changed files
... ...
@@ -80,7 +80,7 @@ func NewCmdProcess(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.
80 80
 	return cmd
81 81
 }
82 82
 
83
-// RunProject contains all the necessary functionality for the OpenShift cli process command
83
+// RunProcess contains all the necessary functionality for the OpenShift cli process command
84 84
 func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
85 85
 	templateName, valueArgs := "", []string{}
86 86
 	for _, s := range args {
... ...
@@ -196,8 +196,6 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
196 196
 		}
197 197
 	}
198 198
 
199
-	outputFormat := kcmdutil.GetFlagString(cmd, "output")
200
-
201 199
 	if len(infos) > 1 {
202 200
 		// in order to run validation on the input given to us by a user, we only support the processing
203 201
 		// of one template in a list. For instance, we want to be able to fail when a user does not give
... ...
@@ -253,6 +251,7 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
253 253
 		return fmt.Errorf("error processing the template %q: %v\n", obj.Name, err)
254 254
 	}
255 255
 
256
+	outputFormat := kcmdutil.GetFlagString(cmd, "output")
256 257
 	if outputFormat == "describe" {
257 258
 		if s, err := (&describe.TemplateDescriber{
258 259
 			MetadataAccessor: meta.NewAccessor(),
... ...
@@ -267,12 +266,6 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
267 267
 	}
268 268
 	objects = append(objects, resultObj.Objects...)
269 269
 
270
-	// Do not print the processed templates when asked to only show parameters or
271
-	// describe.
272
-	if kcmdutil.GetFlagBool(cmd, "parameters") || outputFormat == "describe" {
273
-		return nil
274
-	}
275
-
276 270
 	p, _, err := kubectl.GetPrinter(outputFormat, "", false)
277 271
 	if err != nil {
278 272
 		return err