File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
staging/src/k8s.io/kubectl/pkg/cmd/diff Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ type DiffProgram struct {
130
130
genericclioptions.IOStreams
131
131
}
132
132
133
- func (d * DiffProgram ) getCommand (args ... string ) exec.Cmd {
133
+ func (d * DiffProgram ) getCommand (args ... string ) ( string , exec.Cmd ) {
134
134
diff := ""
135
135
if envDiff := os .Getenv ("KUBECTL_EXTERNAL_DIFF" ); envDiff != "" {
136
136
diff = envDiff
@@ -143,12 +143,16 @@ func (d *DiffProgram) getCommand(args ...string) exec.Cmd {
143
143
cmd .SetStdout (d .Out )
144
144
cmd .SetStderr (d .ErrOut )
145
145
146
- return cmd
146
+ return diff , cmd
147
147
}
148
148
149
149
// Run runs the detected diff program. `from` and `to` are the directory to diff.
150
150
func (d * DiffProgram ) Run (from , to string ) error {
151
- return d .getCommand (from , to ).Run ()
151
+ diff , cmd := d .getCommand (from , to )
152
+ if err := cmd .Run (); err != nil {
153
+ return fmt .Errorf ("failed to run %q: %v" , diff , err )
154
+ }
155
+ return nil
152
156
}
153
157
154
158
// Printer is used to print an object.
You can’t perform that action at this time.
0 commit comments