Merge pull request #110134 from mk46/crictl_env_parse

kubeadm: Parse ENV vars to crictl command
This commit is contained in:
Kubernetes Prow Robot 2022-05-19 14:04:05 -07:00 committed by GitHub
commit e34f51e9b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ limitations under the License.
package runtime
import (
"os"
"strings"
"github.com/pkg/errors"
@ -68,7 +69,9 @@ func (runtime *CRIRuntime) Socket() string {
// crictl creates a crictl command for the provided args.
func (runtime *CRIRuntime) crictl(args ...string) utilsexec.Cmd {
return runtime.exec.Command(runtime.crictlPath, append([]string{"-r", runtime.Socket()}, args...)...)
cmd := runtime.exec.Command(runtime.crictlPath, append([]string{"-r", runtime.Socket()}, args...)...)
cmd.SetEnv(os.Environ())
return cmd
}
// IsRunning checks if runtime is running