Skip to content

Commit 97f25c9

Browse files
jichenjck8s-ci-robot
authored andcommitted
downgrade log of util.ExecuteCommand (#975)
As this error E0531 is not that ueful and no need to be mark this as 'E', use Info level should be fine as this won't affect return value.
1 parent c2faf86 commit 97f25c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/util/util.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,14 @@ func Copy(m *clusterv1.Machine) *clusterv1.Machine {
161161
}
162162

163163
// ExecCommand Executes a local command in the current shell.
164-
func ExecCommand(name string, args ...string) string {
164+
func ExecCommand(name string, args ...string) (string, error) {
165165
cmdOut, err := exec.Command(name, args...).Output()
166166
if err != nil {
167167
s := strings.Join(append([]string{name}, args...), " ")
168-
klog.Errorf("error executing command %q: %v", s, err)
168+
klog.Infof("Executing command %q: %v", s, err)
169+
return string(""), err
169170
}
170-
return string(cmdOut)
171+
return string(cmdOut), nil
171172
}
172173

173174
// Filter filters a list for a string.

0 commit comments

Comments
 (0)