Set the HOME environment variable for sub-containers.

Fixes #701

PiperOrigin-RevId: 316025635
This commit is contained in:
Ian Lewis
2020-06-11 19:31:24 -07:00
committed by gVisor bot
parent 5a894e35a0
commit 8ea99d58ff
5 changed files with 170 additions and 46 deletions
+11
View File
@@ -113,6 +113,17 @@ func (cc *Crictl) Exec(contID string, args ...string) (string, error) {
return output, nil
}
// Logs retrieves the container logs. It corresponds to `crictl logs`.
func (cc *Crictl) Logs(contID string, args ...string) (string, error) {
a := []string{"logs", contID}
a = append(a, args...)
output, err := cc.run(a...)
if err != nil {
return "", fmt.Errorf("logs failed: %v", err)
}
return output, nil
}
// Rm removes a container. It corresponds to `crictl rm`.
func (cc *Crictl) Rm(contID string) error {
_, err := cc.run("rm", contID)