Files
kata-containers/virtcontainers/pkg/vcmock/container.go
Peng Tao f886c0bf35 vc: drop container SetPid API
It is not used by anyone.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
2019-07-22 19:27:52 -07:00

45 lines
1.0 KiB
Go

// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package vcmock
import (
vc "github.com/kata-containers/runtime/virtcontainers"
)
// ID implements the VCContainer function of the same name.
func (c *Container) ID() string {
return c.MockID
}
// Sandbox implements the VCContainer function of the same name.
func (c *Container) Sandbox() vc.VCSandbox {
return c.MockSandbox
}
// Process implements the VCContainer function of the same name.
func (c *Container) Process() vc.Process {
// always return a mockprocess with a non-zero Pid
if c.MockProcess.Pid == 0 {
c.MockProcess.Pid = 1000
}
return c.MockProcess
}
// GetToken implements the VCContainer function of the same name.
func (c *Container) GetToken() string {
return c.MockToken
}
// GetPid implements the VCContainer function of the same name.
func (c *Container) GetPid() int {
return c.MockPid
}
// GetAnnotations implements the VCContainer function of the same name.
func (c *Container) GetAnnotations() map[string]string {
return c.MockAnnotations
}