
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>
30 lines
971 B
Go
30 lines
971 B
Go
package specerror
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
rfc2119 "github.com/opencontainers/runtime-tools/error"
|
|
)
|
|
|
|
// define error codes
|
|
const (
|
|
// ConfigInRootBundleDir represents "This REQUIRED file MUST reside in the root of the bundle directory"
|
|
ConfigInRootBundleDir Code = 0xa001 + iota
|
|
// ConfigConstName represents "This REQUIRED file MUST be named `config.json`."
|
|
ConfigConstName
|
|
// ArtifactsInSingleDir represents "When supplied, while these artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle."
|
|
ArtifactsInSingleDir
|
|
)
|
|
|
|
var (
|
|
containerFormatRef = func(version string) (reference string, err error) {
|
|
return fmt.Sprintf(referenceTemplate, version, "bundle.md#container-format"), nil
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
register(ConfigInRootBundleDir, rfc2119.Must, containerFormatRef)
|
|
register(ConfigConstName, rfc2119.Must, containerFormatRef)
|
|
register(ArtifactsInSingleDir, rfc2119.Must, containerFormatRef)
|
|
}
|