summaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runtime-tools/specerror/config-windows.go
blob: 58765286b9c1478121e2f484e147359f316fc7df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 = "`layerFolders` MUST contain at least one entry."
	// WindowsHyperVPresent represents "If present, the container MUST be run with Hyper-V isolation."
	WindowsHyperVPresent = "If present, the container MUST be run with Hyper-V isolation."
	// WindowsHyperVOmit represents "If omitted, the container MUST be run as a Windows Server container."
	WindowsHyperVOmit = "If omitted, the container MUST be run as a Windows Server container."
)

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)
}