Documentation ¶
Index ¶
- Variables
- type ImageDestination
- func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
- func (i *ImageDestination) CheckManifestChanged(destManifestBytes []byte, instanceDigest *digest.Digest) bool
- func (i *ImageDestination) Close() error
- func (i *ImageDestination) GetManifest(instanceDigest *digest.Digest) []byte
- func (i *ImageDestination) GetRegistry() string
- func (i *ImageDestination) GetRepository() string
- func (i *ImageDestination) GetTagOrDigest() string
- func (i *ImageDestination) PushManifest(manifestByte []byte, instanceDigest *digest.Digest) error
- func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
- func (i *ImageDestination) String() string
- type ImageSource
- func (i *ImageSource) Close() error
- func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
- func (i *ImageSource) GetBlobInfos(manifestObjSlice ...manifest.Manifest) ([]types.BlobInfo, error)
- func (i *ImageSource) GetManifest() ([]byte, string, error)
- func (i *ImageSource) GetRegistry() string
- func (i *ImageSource) GetRepository() string
- func (i *ImageSource) GetSourceRepoTags() ([]string, error)
- func (i *ImageSource) GetTagOrDigest() string
- func (i *ImageSource) String() string
- type ManifestInfo
Constants ¶
This section is empty.
Variables ¶
var ( // NoCache used to disable a blobinfocache NoCache = none.NoCache )
Functions ¶
This section is empty.
Types ¶
type ImageDestination ¶
type ImageDestination struct {
// contains filtered or unexported fields
}
ImageDestination is a reference of a remote image we will push to
func NewImageDestination ¶
func NewImageDestination(registry, repository, tagOrDigest, username, password string, insecure bool) (*ImageDestination, error)
NewImageDestination generates an ImageDestination by repository, the repository string must include tag or digest. If username or password is empty, access to repository will be anonymous.
func (*ImageDestination) CheckBlobExist ¶ added in v1.1.0
func (i *ImageDestination) CheckBlobExist(blobInfo types.BlobInfo) (bool, error)
CheckBlobExist checks if a blob exist for destination and reuse exist blobs
func (*ImageDestination) CheckManifestChanged ¶ added in v1.4.0
func (i *ImageDestination) CheckManifestChanged(destManifestBytes []byte, instanceDigest *digest.Digest) bool
CheckManifestChanged checks if manifest of specified tag or digest has changed.
func (*ImageDestination) GetManifest ¶ added in v1.4.0
func (i *ImageDestination) GetManifest(instanceDigest *digest.Digest) []byte
func (*ImageDestination) GetRegistry ¶
func (i *ImageDestination) GetRegistry() string
GetRegistry returns the registry of a ImageDestination
func (*ImageDestination) GetRepository ¶
func (i *ImageDestination) GetRepository() string
GetRepository returns the repository of a ImageDestination
func (*ImageDestination) GetTagOrDigest ¶ added in v1.5.0
func (i *ImageDestination) GetTagOrDigest() string
GetTagOrDigest return the tag or digest of a ImageDestination
func (*ImageDestination) PushManifest ¶
func (i *ImageDestination) PushManifest(manifestByte []byte, instanceDigest *digest.Digest) error
PushManifest push a manifest file to destination image. If instanceDigest is not nil, it contains a digest of the specific manifest instance to write the manifest for (when the primary manifest is a manifest list); this should always be nil if the primary manifest is not a manifest list.
func (*ImageDestination) PutABlob ¶
func (i *ImageDestination) PutABlob(blob io.ReadCloser, blobInfo types.BlobInfo) error
PutABlob push a blob to destination image
func (*ImageDestination) String ¶ added in v1.5.0
func (i *ImageDestination) String() string
type ImageSource ¶
type ImageSource struct {
// contains filtered or unexported fields
}
ImageSource is a reference to a remote image need to be pulled.
func NewImageSource ¶
func NewImageSource(registry, repository, tagOrDigest, username, password string, insecure bool) (*ImageSource, error)
NewImageSource generates a PullTask by repository, the repository string must include tag or digest, or it can only be used to list tags. If username or password is empty, access to repository will be anonymous. A repository string is the rest part of the images url except tag digest and registry
func (*ImageSource) GetABlob ¶
func (i *ImageSource) GetABlob(blobInfo types.BlobInfo) (io.ReadCloser, int64, error)
GetABlob gets a blob from remote image
func (*ImageSource) GetBlobInfos ¶
GetBlobInfos get blob infos from non-list type manifests.
func (*ImageSource) GetManifest ¶
func (i *ImageSource) GetManifest() ([]byte, string, error)
GetManifest get manifest file from source image
func (*ImageSource) GetRegistry ¶
func (i *ImageSource) GetRegistry() string
GetRegistry returns the registry of a ImageSource
func (*ImageSource) GetRepository ¶
func (i *ImageSource) GetRepository() string
GetRepository returns the repository of a ImageSource
func (*ImageSource) GetSourceRepoTags ¶
func (i *ImageSource) GetSourceRepoTags() ([]string, error)
GetSourceRepoTags gets all the tags of a repository which ImageSource belongs to
func (*ImageSource) GetTagOrDigest ¶ added in v1.5.0
func (i *ImageSource) GetTagOrDigest() string
GetTagOrDigest returns the tag or digest a ImageSource
func (*ImageSource) String ¶ added in v1.5.0
func (i *ImageSource) String() string
type ManifestInfo ¶ added in v1.4.0
type ManifestInfo struct { Obj manifest.Manifest Digest *digest.Digest // (manifest.Manifest).Serialize() does not in general reproduce the original blob if this object was loaded from one, // even if no modifications were made! Non-list type image seems cannot use the result to push to dest // repo while it is a part of list-type image. Bytes []byte }
func GenerateManifestObj ¶ added in v1.4.0
func GenerateManifestObj(manifestBytes []byte, manifestType string, osFilterList, archFilterList []string, i *ImageSource, parent *manifest.Schema2List) (interface{}, []byte, []*ManifestInfo, error)
GenerateManifestObj returns a new manifest object along with its byte serialization, and a sub manifest object array, and a digest array of sub manifests for list-type manifests. For list type manifest, the origin manifest info might be modified because of platform filters, and a nil manifest object will be returned if no sub manifest need to transport. For non-list type manifests, which doesn't match the filters, a nil manifest object will be returned.