mirror of
https://github.com/containers/skopeo.git
synced 2025-08-25 17:49:06 +00:00
vendor containers/image@93b1deece2
Don't get tricked by the v1.5.2-0.20190620105408-93b1deece293 reference in the go.mod file. The upper commit is *after* v2.0.0 and go simply has a bug in dealing with git tags. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
parent
5417561b4a
commit
a700ec5ff2
2
go.mod
2
go.mod
@ -9,7 +9,7 @@ require (
|
|||||||
github.com/VividCortex/ewma v1.1.1 // indirect
|
github.com/VividCortex/ewma v1.1.1 // indirect
|
||||||
github.com/containerd/continuity v0.0.0-20180216233310-d8fb8589b0e8 // indirect
|
github.com/containerd/continuity v0.0.0-20180216233310-d8fb8589b0e8 // indirect
|
||||||
github.com/containers/buildah v1.8.4
|
github.com/containers/buildah v1.8.4
|
||||||
github.com/containers/image v2.0.0+incompatible
|
github.com/containers/image v1.5.2-0.20190620105408-93b1deece293
|
||||||
github.com/containers/storage v1.12.10
|
github.com/containers/storage v1.12.10
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/docker/distribution v0.0.0-20170817175659-5f6282db7d65 // indirect
|
github.com/docker/distribution v0.0.0-20170817175659-5f6282db7d65 // indirect
|
||||||
|
2
go.sum
2
go.sum
@ -10,6 +10,8 @@ github.com/containerd/continuity v0.0.0-20180216233310-d8fb8589b0e8 h1:ZZOFPzvZO
|
|||||||
github.com/containerd/continuity v0.0.0-20180216233310-d8fb8589b0e8/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
github.com/containerd/continuity v0.0.0-20180216233310-d8fb8589b0e8/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
|
||||||
github.com/containers/buildah v1.8.4 h1:06c+UNeEWMa2wA1Z7muZ0ZqUzE91sDuZJbB0BiZaeYQ=
|
github.com/containers/buildah v1.8.4 h1:06c+UNeEWMa2wA1Z7muZ0ZqUzE91sDuZJbB0BiZaeYQ=
|
||||||
github.com/containers/buildah v1.8.4/go.mod h1:1CsiLJvyU+h+wOjnqJJOWuJCVcMxZOr5HN/gHGdzJxY=
|
github.com/containers/buildah v1.8.4/go.mod h1:1CsiLJvyU+h+wOjnqJJOWuJCVcMxZOr5HN/gHGdzJxY=
|
||||||
|
github.com/containers/image v1.5.2-0.20190620105408-93b1deece293 h1:EalCgZ875kDCN2HcOch50q48GKerWGc5eV0BllCvln8=
|
||||||
|
github.com/containers/image v1.5.2-0.20190620105408-93b1deece293/go.mod h1:8Vtij257IWSanUQKe1tAeNOm2sRVkSqQTVQ1IlwI3+M=
|
||||||
github.com/containers/image v2.0.0+incompatible h1:FTr6Br7jlIKNCKMjSOMbAxKp2keQ0//jzJaYNTVhauk=
|
github.com/containers/image v2.0.0+incompatible h1:FTr6Br7jlIKNCKMjSOMbAxKp2keQ0//jzJaYNTVhauk=
|
||||||
github.com/containers/image v2.0.0+incompatible/go.mod h1:8Vtij257IWSanUQKe1tAeNOm2sRVkSqQTVQ1IlwI3+M=
|
github.com/containers/image v2.0.0+incompatible/go.mod h1:8Vtij257IWSanUQKe1tAeNOm2sRVkSqQTVQ1IlwI3+M=
|
||||||
github.com/containers/storage v1.12.10 h1:vw1aiLsZ1LvO09ELMxVBTe35tThRiMftI2cPeH+G5ow=
|
github.com/containers/storage v1.12.10 h1:vw1aiLsZ1LvO09ELMxVBTe35tThRiMftI2cPeH+G5ow=
|
||||||
|
13
vendor/github.com/containers/image/docker/docker_image_src.go
generated
vendored
13
vendor/github.com/containers/image/docker/docker_image_src.go
generated
vendored
@ -138,8 +138,9 @@ func (s *dockerImageSource) GetManifest(ctx context.Context, instanceDigest *dig
|
|||||||
|
|
||||||
func (s *dockerImageSource) fetchManifest(ctx context.Context, tagOrDigest string) ([]byte, string, error) {
|
func (s *dockerImageSource) fetchManifest(ctx context.Context, tagOrDigest string) ([]byte, string, error) {
|
||||||
path := fmt.Sprintf(manifestPath, reference.Path(s.ref.ref), tagOrDigest)
|
path := fmt.Sprintf(manifestPath, reference.Path(s.ref.ref), tagOrDigest)
|
||||||
headers := make(map[string][]string)
|
headers := map[string][]string{
|
||||||
headers["Accept"] = manifest.DefaultRequestedManifestMIMETypes
|
"Accept": manifest.DefaultRequestedManifestMIMETypes,
|
||||||
|
}
|
||||||
res, err := s.c.makeRequest(ctx, "GET", path, headers, nil, v2Auth, nil)
|
res, err := s.c.makeRequest(ctx, "GET", path, headers, nil, v2Auth, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
@ -381,11 +382,9 @@ func deleteImage(ctx context.Context, sys *types.SystemContext, ref dockerRefere
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// When retrieving the digest from a registry >= 2.3 use the following header:
|
headers := map[string][]string{
|
||||||
// "Accept": "application/vnd.docker.distribution.manifest.v2+json"
|
"Accept": manifest.DefaultRequestedManifestMIMETypes,
|
||||||
headers := make(map[string][]string)
|
}
|
||||||
headers["Accept"] = []string{manifest.DockerV2Schema2MediaType}
|
|
||||||
|
|
||||||
refTail, err := ref.tagOrDigest()
|
refTail, err := ref.tagOrDigest()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
87
vendor/github.com/containers/image/docker/tarfile/src.go
generated
vendored
87
vendor/github.com/containers/image/docker/tarfile/src.go
generated
vendored
@ -15,24 +15,24 @@ import (
|
|||||||
"github.com/containers/image/manifest"
|
"github.com/containers/image/manifest"
|
||||||
"github.com/containers/image/pkg/compression"
|
"github.com/containers/image/pkg/compression"
|
||||||
"github.com/containers/image/types"
|
"github.com/containers/image/types"
|
||||||
"github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Source is a partial implementation of types.ImageSource for reading from tarPath.
|
// Source is a partial implementation of types.ImageSource for reading from tarPath.
|
||||||
type Source struct {
|
type Source struct {
|
||||||
tarPath string
|
tarPath string
|
||||||
removeTarPathOnClose bool // Remove temp file on close if true
|
removeTarPathOnClose bool // Remove temp file on close if true
|
||||||
cacheDataLock sync.Once // Atomic way to ensure that ensureCachedDataIsPresent is only invoked once
|
|
||||||
// The following data is only available after ensureCachedDataIsPresent() succeeds
|
// The following data is only available after ensureCachedDataIsPresent() succeeds
|
||||||
cacheDataResult error // The return value of ensureCachedDataIsPresent, since it should be as safe to cache as the side effects
|
|
||||||
tarManifest *ManifestItem // nil if not available yet.
|
tarManifest *ManifestItem // nil if not available yet.
|
||||||
configBytes []byte
|
configBytes []byte
|
||||||
configDigest digest.Digest
|
configDigest digest.Digest
|
||||||
orderedDiffIDList []digest.Digest
|
orderedDiffIDList []digest.Digest
|
||||||
knownLayers map[digest.Digest]*layerInfo
|
knownLayers map[digest.Digest]*layerInfo
|
||||||
// Other state
|
// Other state
|
||||||
generatedManifest []byte // Private cache for GetManifest(), nil if not set yet.
|
generatedManifest []byte // Private cache for GetManifest(), nil if not set yet.
|
||||||
|
cacheDataLock sync.Once // Private state for ensureCachedDataIsPresent to make it concurrency-safe
|
||||||
|
cacheDataResult error // Private state for ensureCachedDataIsPresent
|
||||||
}
|
}
|
||||||
|
|
||||||
type layerInfo struct {
|
type layerInfo struct {
|
||||||
@ -201,49 +201,52 @@ func (s *Source) readTarComponent(path string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ensureCachedDataIsPresent loads data necessary for any of the public accessors.
|
// ensureCachedDataIsPresent loads data necessary for any of the public accessors.
|
||||||
|
// It is safe to call this from multi-threaded code.
|
||||||
func (s *Source) ensureCachedDataIsPresent() error {
|
func (s *Source) ensureCachedDataIsPresent() error {
|
||||||
s.cacheDataLock.Do(func() {
|
s.cacheDataLock.Do(func() {
|
||||||
// Read and parse manifest.json
|
s.cacheDataResult = s.ensureCachedDataIsPresentPrivate()
|
||||||
tarManifest, err := s.loadTarManifest()
|
|
||||||
if err != nil {
|
|
||||||
s.cacheDataResult = err
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check to make sure length is 1
|
|
||||||
if len(tarManifest) != 1 {
|
|
||||||
s.cacheDataResult = errors.Errorf("Unexpected tar manifest.json: expected 1 item, got %d", len(tarManifest))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read and parse config.
|
|
||||||
configBytes, err := s.readTarComponent(tarManifest[0].Config)
|
|
||||||
if err != nil {
|
|
||||||
s.cacheDataResult = err
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var parsedConfig manifest.Schema2Image // There's a lot of info there, but we only really care about layer DiffIDs.
|
|
||||||
if err := json.Unmarshal(configBytes, &parsedConfig); err != nil {
|
|
||||||
s.cacheDataResult = errors.Wrapf(err, "Error decoding tar config %s", tarManifest[0].Config)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
knownLayers, err := s.prepareLayerData(&tarManifest[0], &parsedConfig)
|
|
||||||
if err != nil {
|
|
||||||
s.cacheDataResult = err
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Success; commit.
|
|
||||||
s.tarManifest = &tarManifest[0]
|
|
||||||
s.configBytes = configBytes
|
|
||||||
s.configDigest = digest.FromBytes(configBytes)
|
|
||||||
s.orderedDiffIDList = parsedConfig.RootFS.DiffIDs
|
|
||||||
s.knownLayers = knownLayers
|
|
||||||
})
|
})
|
||||||
return s.cacheDataResult
|
return s.cacheDataResult
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ensureCachedDataIsPresentPrivate is a private implementation detail of ensureCachedDataIsPresent.
|
||||||
|
// Call ensureCachedDataIsPresent instead.
|
||||||
|
func (s *Source) ensureCachedDataIsPresentPrivate() error {
|
||||||
|
// Read and parse manifest.json
|
||||||
|
tarManifest, err := s.loadTarManifest()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check to make sure length is 1
|
||||||
|
if len(tarManifest) != 1 {
|
||||||
|
return errors.Errorf("Unexpected tar manifest.json: expected 1 item, got %d", len(tarManifest))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read and parse config.
|
||||||
|
configBytes, err := s.readTarComponent(tarManifest[0].Config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var parsedConfig manifest.Schema2Image // There's a lot of info there, but we only really care about layer DiffIDs.
|
||||||
|
if err := json.Unmarshal(configBytes, &parsedConfig); err != nil {
|
||||||
|
return errors.Wrapf(err, "Error decoding tar config %s", tarManifest[0].Config)
|
||||||
|
}
|
||||||
|
|
||||||
|
knownLayers, err := s.prepareLayerData(&tarManifest[0], &parsedConfig)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Success; commit.
|
||||||
|
s.tarManifest = &tarManifest[0]
|
||||||
|
s.configBytes = configBytes
|
||||||
|
s.configDigest = digest.FromBytes(configBytes)
|
||||||
|
s.orderedDiffIDList = parsedConfig.RootFS.DiffIDs
|
||||||
|
s.knownLayers = knownLayers
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// loadTarManifest loads and decodes the manifest.json.
|
// loadTarManifest loads and decodes the manifest.json.
|
||||||
func (s *Source) loadTarManifest() ([]ManifestItem, error) {
|
func (s *Source) loadTarManifest() ([]ManifestItem, error) {
|
||||||
// FIXME? Do we need to deal with the legacy format?
|
// FIXME? Do we need to deal with the legacy format?
|
||||||
|
2
vendor/github.com/containers/image/ostree/ostree_dest.go
generated
vendored
2
vendor/github.com/containers/image/ostree/ostree_dest.go
generated
vendored
@ -218,7 +218,7 @@ func fixFiles(selinuxHnd *C.struct_selabel_handle, root string, dir string, user
|
|||||||
defer C.free(unsafe.Pointer(fullpathC))
|
defer C.free(unsafe.Pointer(fullpathC))
|
||||||
res, err = C.lsetfilecon_raw(fullpathC, context)
|
res, err = C.lsetfilecon_raw(fullpathC, context)
|
||||||
if int(res) < 0 {
|
if int(res) < 0 {
|
||||||
return errors.Wrapf(err, "cannot setfilecon_raw %s", fullpath)
|
return errors.Wrapf(err, "cannot setfilecon_raw %s to %s", fullpath, C.GoString(context))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
24
vendor/github.com/containers/image/pkg/sysregistriesv2/system_registries_v2.go
generated
vendored
24
vendor/github.com/containers/image/pkg/sysregistriesv2/system_registries_v2.go
generated
vendored
@ -30,10 +30,10 @@ const builtinRegistriesConfPath = "/etc/containers/registries.conf"
|
|||||||
// Endpoint describes a remote location of a registry.
|
// Endpoint describes a remote location of a registry.
|
||||||
type Endpoint struct {
|
type Endpoint struct {
|
||||||
// The endpoint's remote location.
|
// The endpoint's remote location.
|
||||||
Location string `toml:"location"`
|
Location string `toml:"location,omitempty"`
|
||||||
// If true, certs verification will be skipped and HTTP (non-TLS)
|
// If true, certs verification will be skipped and HTTP (non-TLS)
|
||||||
// connections will be allowed.
|
// connections will be allowed.
|
||||||
Insecure bool `toml:"insecure"`
|
Insecure bool `toml:"insecure,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// rewriteReference will substitute the provided reference `prefix` to the
|
// rewriteReference will substitute the provided reference `prefix` to the
|
||||||
@ -56,22 +56,22 @@ func (e *Endpoint) rewriteReference(ref reference.Named, prefix string) (referen
|
|||||||
|
|
||||||
// Registry represents a registry.
|
// Registry represents a registry.
|
||||||
type Registry struct {
|
type Registry struct {
|
||||||
// A registry is an Endpoint too
|
|
||||||
Endpoint
|
|
||||||
// The registry's mirrors.
|
|
||||||
Mirrors []Endpoint `toml:"mirror"`
|
|
||||||
// If true, pulling from the registry will be blocked.
|
|
||||||
Blocked bool `toml:"blocked"`
|
|
||||||
// If true, mirrors will only be used for digest pulls. Pulling images by
|
|
||||||
// tag can potentially yield different images, depending on which endpoint
|
|
||||||
// we pull from. Forcing digest-pulls for mirrors avoids that issue.
|
|
||||||
MirrorByDigestOnly bool `toml:"mirror-by-digest-only"`
|
|
||||||
// Prefix is used for matching images, and to translate one namespace to
|
// Prefix is used for matching images, and to translate one namespace to
|
||||||
// another. If `Prefix="example.com/bar"`, `location="example.com/foo/bar"`
|
// another. If `Prefix="example.com/bar"`, `location="example.com/foo/bar"`
|
||||||
// and we pull from "example.com/bar/myimage:latest", the image will
|
// and we pull from "example.com/bar/myimage:latest", the image will
|
||||||
// effectively be pulled from "example.com/foo/bar/myimage:latest".
|
// effectively be pulled from "example.com/foo/bar/myimage:latest".
|
||||||
// If no Prefix is specified, it defaults to the specified location.
|
// If no Prefix is specified, it defaults to the specified location.
|
||||||
Prefix string `toml:"prefix"`
|
Prefix string `toml:"prefix"`
|
||||||
|
// A registry is an Endpoint too
|
||||||
|
Endpoint
|
||||||
|
// The registry's mirrors.
|
||||||
|
Mirrors []Endpoint `toml:"mirror,omitempty"`
|
||||||
|
// If true, pulling from the registry will be blocked.
|
||||||
|
Blocked bool `toml:"blocked,omitempty"`
|
||||||
|
// If true, mirrors will only be used for digest pulls. Pulling images by
|
||||||
|
// tag can potentially yield different images, depending on which endpoint
|
||||||
|
// we pull from. Forcing digest-pulls for mirrors avoids that issue.
|
||||||
|
MirrorByDigestOnly bool `toml:"mirror-by-digest-only,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PullSource consists of an Endpoint and a Reference. Note that the reference is
|
// PullSource consists of an Endpoint and a Reference. Note that the reference is
|
||||||
|
13
vendor/github.com/containers/image/storage/storage_image.go
generated
vendored
13
vendor/github.com/containers/image/storage/storage_image.go
generated
vendored
@ -491,14 +491,21 @@ func (s *storageImageDestination) TryReusingBlob(ctx context.Context, blobinfo t
|
|||||||
|
|
||||||
// Does the blob correspond to a known DiffID which we already have available?
|
// Does the blob correspond to a known DiffID which we already have available?
|
||||||
// Because we must return the size, which is unknown for unavailable compressed blobs, the returned BlobInfo refers to the
|
// Because we must return the size, which is unknown for unavailable compressed blobs, the returned BlobInfo refers to the
|
||||||
// uncompressed layer, and that can happen only if canSubstitute.
|
// uncompressed layer, and that can happen only if canSubstitute, or if the incoming manifest already specifies the size.
|
||||||
if canSubstitute {
|
if canSubstitute || blobinfo.Size != -1 {
|
||||||
if uncompressedDigest := cache.UncompressedDigest(blobinfo.Digest); uncompressedDigest != "" && uncompressedDigest != blobinfo.Digest {
|
if uncompressedDigest := cache.UncompressedDigest(blobinfo.Digest); uncompressedDigest != "" && uncompressedDigest != blobinfo.Digest {
|
||||||
layers, err := s.imageRef.transport.store.LayersByUncompressedDigest(uncompressedDigest)
|
layers, err := s.imageRef.transport.store.LayersByUncompressedDigest(uncompressedDigest)
|
||||||
if err != nil && errors.Cause(err) != storage.ErrLayerUnknown {
|
if err != nil && errors.Cause(err) != storage.ErrLayerUnknown {
|
||||||
return false, types.BlobInfo{}, errors.Wrapf(err, `Error looking for layers with digest %q`, uncompressedDigest)
|
return false, types.BlobInfo{}, errors.Wrapf(err, `Error looking for layers with digest %q`, uncompressedDigest)
|
||||||
}
|
}
|
||||||
if len(layers) > 0 {
|
if len(layers) > 0 {
|
||||||
|
if blobinfo.Size != -1 {
|
||||||
|
s.blobDiffIDs[blobinfo.Digest] = layers[0].UncompressedDigest
|
||||||
|
return true, blobinfo, nil
|
||||||
|
}
|
||||||
|
if !canSubstitute {
|
||||||
|
return false, types.BlobInfo{}, fmt.Errorf("Internal error: canSubstitute was expected to be true for blobInfo %v", blobinfo)
|
||||||
|
}
|
||||||
s.blobDiffIDs[uncompressedDigest] = layers[0].UncompressedDigest
|
s.blobDiffIDs[uncompressedDigest] = layers[0].UncompressedDigest
|
||||||
return true, types.BlobInfo{
|
return true, types.BlobInfo{
|
||||||
Digest: uncompressedDigest,
|
Digest: uncompressedDigest,
|
||||||
@ -627,7 +634,7 @@ func (s *storageImageDestination) Commit(ctx context.Context) error {
|
|||||||
if !ok {
|
if !ok {
|
||||||
// Try to find the layer with contents matching that blobsum.
|
// Try to find the layer with contents matching that blobsum.
|
||||||
layer := ""
|
layer := ""
|
||||||
layers, err2 := s.imageRef.transport.store.LayersByUncompressedDigest(blob.Digest)
|
layers, err2 := s.imageRef.transport.store.LayersByUncompressedDigest(diffID)
|
||||||
if err2 == nil && len(layers) > 0 {
|
if err2 == nil && len(layers) > 0 {
|
||||||
layer = layers[0].ID
|
layer = layers[0].ID
|
||||||
} else {
|
} else {
|
||||||
|
4
vendor/github.com/containers/image/version/version.go
generated
vendored
4
vendor/github.com/containers/image/version/version.go
generated
vendored
@ -8,10 +8,10 @@ const (
|
|||||||
// VersionMinor is for functionality in a backwards-compatible manner
|
// VersionMinor is for functionality in a backwards-compatible manner
|
||||||
VersionMinor = 0
|
VersionMinor = 0
|
||||||
// VersionPatch is for backwards-compatible bug fixes
|
// VersionPatch is for backwards-compatible bug fixes
|
||||||
VersionPatch = 0
|
VersionPatch = 1
|
||||||
|
|
||||||
// VersionDev indicates development branch. Releases will be empty string.
|
// VersionDev indicates development branch. Releases will be empty string.
|
||||||
VersionDev = ""
|
VersionDev = "-dev"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the specification version that the package types support.
|
// Version is the specification version that the package types support.
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -26,7 +26,7 @@ github.com/VividCortex/ewma
|
|||||||
github.com/containerd/continuity/pathdriver
|
github.com/containerd/continuity/pathdriver
|
||||||
# github.com/containers/buildah v1.8.4
|
# github.com/containers/buildah v1.8.4
|
||||||
github.com/containers/buildah/pkg/unshare
|
github.com/containers/buildah/pkg/unshare
|
||||||
# github.com/containers/image v2.0.0+incompatible
|
# github.com/containers/image v1.5.2-0.20190620105408-93b1deece293
|
||||||
github.com/containers/image/copy
|
github.com/containers/image/copy
|
||||||
github.com/containers/image/directory
|
github.com/containers/image/directory
|
||||||
github.com/containers/image/docker
|
github.com/containers/image/docker
|
||||||
|
Loading…
Reference in New Issue
Block a user