Merge pull request #38891 from krousey/gceimageupgrade
Automatic merge from submit-queue (batch tested with PRs 38426, 38917, 38891, 38935) Support different image during GCE node upgrade **What this PR does / why we need it**: It lets GCE upgrade tests upgrade to a GCI node image. **Which issue this PR fixes**: fixes #37855
This commit is contained in:
@@ -4869,6 +4869,13 @@ func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[strin
|
||||
// RunCmd runs cmd using args and returns its stdout and stderr. It also outputs
|
||||
// cmd's stdout and stderr to their respective OS streams.
|
||||
func RunCmd(command string, args ...string) (string, string, error) {
|
||||
return RunCmdEnv(nil, command, args...)
|
||||
}
|
||||
|
||||
// RunCmdEnv runs cmd with the provided environment and args and
|
||||
// returns its stdout and stderr. It also outputs cmd's stdout and
|
||||
// stderr to their respective OS streams.
|
||||
func RunCmdEnv(env []string, command string, args ...string) (string, string, error) {
|
||||
Logf("Running %s %v", command, args)
|
||||
var bout, berr bytes.Buffer
|
||||
cmd := exec.Command(command, args...)
|
||||
@@ -4879,6 +4886,7 @@ func RunCmd(command string, args ...string) (string, string, error) {
|
||||
// newlines.
|
||||
cmd.Stdout = io.MultiWriter(os.Stdout, &bout)
|
||||
cmd.Stderr = io.MultiWriter(os.Stderr, &berr)
|
||||
cmd.Env = env
|
||||
err := cmd.Run()
|
||||
stdout, stderr := bout.String(), berr.String()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user