summaryrefslogtreecommitdiffhomepage
path: root/runsc/sandbox
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-08-04 23:48:28 +0000
committergVisor bot <gvisor-bot@google.com>2021-08-04 23:48:28 +0000
commita1356634b1f3f89aee4acd2b7966df31b29fb97c (patch)
treecb1b8ed2b70e627c99186e904f1f3c5493015119 /runsc/sandbox
parente6ce797f3838622a396586f4f85b78241af85c64 (diff)
parentcbb99336cee7d37f4050875a95946ca88b7ac690 (diff)
Merge release-20210726.0-32-gcbb99336c (automated)
Diffstat (limited to 'runsc/sandbox')
-rw-r--r--runsc/sandbox/sandbox.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go
index 822da8c5e..b15572a98 100644
--- a/runsc/sandbox/sandbox.go
+++ b/runsc/sandbox/sandbox.go
@@ -1002,6 +1002,24 @@ func (s *Sandbox) Resume(cid string) error {
return nil
}
+// Cat sends the cat call for a container in the sandbox.
+func (s *Sandbox) Cat(cid string, files []string, out *os.File) error {
+ log.Debugf("Cat sandbox %q", s.ID)
+ conn, err := s.sandboxConnect()
+ if err != nil {
+ return err
+ }
+ defer conn.Close()
+
+ if err := conn.Call(boot.FsCat, &control.CatOpts{
+ Files: files,
+ FilePayload: urpc.FilePayload{Files: []*os.File{out}},
+ }, nil); err != nil {
+ return fmt.Errorf("Cat container %q: %v", cid, err)
+ }
+ return nil
+}
+
// IsRunning returns true if the sandbox or gofer process is running.
func (s *Sandbox) IsRunning() bool {
if s.Pid != 0 {