Skip to content
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

Fixed an error description of func, and deleted redundant codes #10778

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions pkg/cmd/cli/cmd/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewCmdProcess(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.
return cmd
}

// RunProject contains all the necessary functionality for the OpenShift cli process command
// RunProcess contains all the necessary functionality for the OpenShift cli process command
func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
templateName, valueArgs := "", []string{}
for _, s := range args {
Expand Down Expand Up @@ -196,8 +196,6 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
}
}

outputFormat := kcmdutil.GetFlagString(cmd, "output")

if len(infos) > 1 {
// in order to run validation on the input given to us by a user, we only support the processing
// of one template in a list. For instance, we want to be able to fail when a user does not give
Expand Down Expand Up @@ -253,6 +251,7 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
return fmt.Errorf("error processing the template %q: %v\n", obj.Name, err)
}

outputFormat := kcmdutil.GetFlagString(cmd, "output")
if outputFormat == "describe" {
if s, err := (&describe.TemplateDescriber{
MetadataAccessor: meta.NewAccessor(),
Expand All @@ -267,12 +266,6 @@ func RunProcess(f *clientcmd.Factory, out io.Writer, cmd *cobra.Command, args []
}
objects = append(objects, resultObj.Objects...)

// Do not print the processed templates when asked to only show parameters or
// describe.
if kcmdutil.GetFlagBool(cmd, "parameters") || outputFormat == "describe" {
return nil
}

p, _, err := kubectl.GetPrinter(outputFormat, "", false)
if err != nil {
return err
Expand Down