mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 18:44:47 +01:00
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>
51 lines
1.2 KiB
Go
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
|
|
}
|