
Also add new dependencies on github.com/xeipuuv/gojson* (brought up by new runtime-tools) and adapt the containerd/cri code to replace the APIs that were removed by runtime-tools. In particular, add new helpers to handle the capabilities, since runtime-tools now split them into separate sets of functions for each capability set. Replace g.Spec() with g.Config since g.Spec() has been deprecated in the runtime-tools API. Signed-off-by: Filipe Brandenburger <filbranden@google.com>
33 lines
1.0 KiB
Go
33 lines
1.0 KiB
Go
package specerror
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
rfc2119 "github.com/opencontainers/runtime-tools/error"
|
|
)
|
|
|
|
// define error codes
|
|
const (
|
|
// WindowsLayerFoldersRequired represents "`layerFolders` MUST contain at least one entry."
|
|
WindowsLayerFoldersRequired Code = 0xd001 + iota
|
|
// WindowsHyperVPresent represents "If present, the container MUST be run with Hyper-V isolation."
|
|
WindowsHyperVPresent
|
|
// WindowsHyperVOmit represents "If omitted, the container MUST be run as a Windows Server container."
|
|
WindowsHyperVOmit
|
|
)
|
|
|
|
var (
|
|
layerfoldersRef = func(version string) (reference string, err error) {
|
|
return fmt.Sprintf(referenceTemplate, version, "config-windows.md#layerfolders"), nil
|
|
}
|
|
hypervRef = func(version string) (reference string, err error) {
|
|
return fmt.Sprintf(referenceTemplate, version, "config-windows.md#hyperv"), nil
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
register(WindowsLayerFoldersRequired, rfc2119.Must, layerfoldersRef)
|
|
register(WindowsHyperVPresent, rfc2119.Must, hypervRef)
|
|
register(WindowsHyperVOmit, rfc2119.Must, hypervRef)
|
|
}
|