Skip to content

Commit ca9bb8e

Browse files
committed
*: use types from specs-go/
Signed-off-by: Antonio Murdaca <[email protected]>
1 parent bedfc7e commit ca9bb8e

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

image/config.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,12 @@ import (
2626
"strings"
2727

2828
"github.com/opencontainers/image-spec/schema"
29+
"github.com/opencontainers/image-spec/specs-go/v1"
2930
"github.com/opencontainers/runtime-spec/specs-go"
3031
"github.com/pkg/errors"
3132
)
3233

33-
type cfg struct {
34-
User string
35-
Memory int64
36-
MemorySwap int64
37-
CPUShares int64 `json:"CpuShares"`
38-
ExposedPorts map[string]struct{}
39-
Env []string
40-
Entrypoint []string
41-
Cmd []string
42-
Volumes map[string]struct{}
43-
WorkingDir string
44-
}
45-
46-
type config struct {
47-
Architecture string `json:"architecture"`
48-
OS string `json:"os"`
49-
Config cfg `json:"config"`
50-
}
34+
type config v1.Image
5135

5236
func findConfig(w walker, d *descriptor) (*config, error) {
5337
var c config

schema/schema.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414

1515
package schema
1616

17-
import "net/http"
17+
import (
18+
"net/http"
19+
20+
"github.com/opencontainers/image-spec/specs-go/v1"
21+
)
1822

1923
// Media types for the OCI image formats
2024
const (
21-
MediaTypeDescriptor Validator = `application/vnd.oci.descriptor.v1+json`
22-
MediaTypeManifest Validator = `application/vnd.oci.image.manifest.v1+json`
23-
MediaTypeManifestList Validator = `application/vnd.oci.image.manifest.list.v1+json`
24-
MediaTypeImageConfig Validator = `application/vnd.oci.image.config.v1+json`
25-
MediaTypeImageLayer unimplemented = `application/vnd.oci.image.layer.tar+gzip`
25+
MediaTypeDescriptor Validator = v1.MediaTypeDescriptor
26+
MediaTypeManifest Validator = v1.MediaTypeImageManifest
27+
MediaTypeManifestList Validator = v1.MediaTypeImageManifestList
28+
MediaTypeImageConfig Validator = v1.MediaTypeImageConfig
29+
MediaTypeImageLayer unimplemented = v1.MediaTypeImageLayer
2630
)
2731

2832
var (

0 commit comments

Comments
 (0)