Files
kata-containers/virtcontainers/pkg/vcmock/container.go
Graham whaley d6c3ec864b license: SPDX: update all vc files to use SPDX style
When imported, the vc files carried in the 'full style' apache
license text, but the standard for kata is to use SPDX style.
Update the relevant files to SPDX.

Fixes: #227

Signed-off-by: Graham whaley <graham.whaley@intel.com>
2018-04-18 13:43:15 +01:00

51 lines
1.2 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
}
// SetPid implements the VCContainer function of the same name.
func (c *Container) SetPid(pid int) error {
c.MockPid = pid
return nil
}
// GetAnnotations implements the VCContainer function of the same name.
func (c *Container) GetAnnotations() map[string]string {
return c.MockAnnotations
}