Documentation
¶
Index ¶
- Constants
- func CheckArchSummaryComplianceWithPlatform(tarFile string, expectedOsArch string, archSummary []ImageSummary) error
- func CheckOsArchCompliance(tarFile string) error
- func CheckOsArchComplianceWithPlatform(tarFile string, expectedOsArch string) error
- func CheckTagCompliance(targetImage string) string
- func ImageInFile(filePath string, reader io.ReadSeeker, closer io.Closer) ([]ImageSummary, []CompatibleImage, error)
- type ArchReader
- type CompatibleImage
- func (c CompatibleImage) Compressed() (io.ReadCloser, error)
- func (c CompatibleImage) ConfigFile() (*v1.ConfigFile, error)
- func (c CompatibleImage) ConfigName() (v1.Hash, error)
- func (c CompatibleImage) Digest() (v1.Hash, error)
- func (c CompatibleImage) LayerByDiffID(h v1.Hash) (v1.Layer, error)
- func (c CompatibleImage) LayerByDigest(h v1.Hash) (v1.Layer, error)
- func (c CompatibleImage) Layers() ([]v1.Layer, error)
- func (c CompatibleImage) Manifest() (*v1.Manifest, error)
- func (c CompatibleImage) MediaType() (types.MediaType, error)
- func (c CompatibleImage) RawConfigFile() ([]byte, error)
- func (c CompatibleImage) RawManifest() ([]byte, error)
- func (c CompatibleImage) Size() (int64, error)
- func (c CompatibleImage) Uncompressed() (io.ReadCloser, error)
- type DockerManifest
- type DockerPackageManifestItem
- type Image
- type ImageConfig
- type ImageInfo
- type ImageMetaData
- type ImageSummary
- type OCIDescriptor
- type OCIIndex
- type OCIIndexManifest
- type OCIManifest
- type OCIPlatform
- type Store
- type TarReader
- type TarfileOsArchUnsupportedError
Constants ¶
View Source
const ( MediaTypeDockerManifestListV2 = "application/vnd.docker.distribution.manifest.list.v2+json" MediaTypeDockerManifestV2 = "application/vnd.docker.distribution.manifest.v2+json" MediaTypeDockerConfigV1 = "application/vnd.docker.container.image.v1+json" MediaTypeDockerLayerGzip = "application/vnd.docker.image.rootfs.diff.tar.gzip" MediaTypeDockerLayerTar = "application/vnd.docker.image.rootfs.diff.tar" )
Variables ¶
This section is empty.
Functions ¶
func CheckArchSummaryComplianceWithPlatform ¶
func CheckArchSummaryComplianceWithPlatform(tarFile string, expectedOsArch string, archSummary []ImageSummary) error
func CheckOsArchCompliance ¶
func CheckOsArchComplianceWithPlatform ¶
*
- CheckOsArchComplianceWithPlatform opens the tar file and checks platform compatibility.
func CheckTagCompliance ¶
CheckTagCompliance ensures that the given image name is in a valid format by adding default values for registry and repository if they are missing.
func ImageInFile ¶
func ImageInFile(filePath string, reader io.ReadSeeker, closer io.Closer) ([]ImageSummary, []CompatibleImage, error)
*
- ImageInFile parses the image tarball using an external stream.
- The caller is responsible for opening and closing the file/stream.
Types ¶
type ArchReader ¶
type ArchReader struct {
// contains filtered or unexported fields
}
type CompatibleImage ¶
func (CompatibleImage) Compressed ¶
func (c CompatibleImage) Compressed() (io.ReadCloser, error)
func (CompatibleImage) ConfigFile ¶
func (c CompatibleImage) ConfigFile() (*v1.ConfigFile, error)
func (CompatibleImage) ConfigName ¶
func (c CompatibleImage) ConfigName() (v1.Hash, error)
func (CompatibleImage) LayerByDiffID ¶
func (CompatibleImage) LayerByDigest ¶
func (CompatibleImage) RawConfigFile ¶
func (c CompatibleImage) RawConfigFile() ([]byte, error)
func (CompatibleImage) RawManifest ¶
func (c CompatibleImage) RawManifest() ([]byte, error)
func (CompatibleImage) Size ¶
func (c CompatibleImage) Size() (int64, error)
func (CompatibleImage) Uncompressed ¶
func (c CompatibleImage) Uncompressed() (io.ReadCloser, error)
type DockerManifest ¶
type ImageConfig ¶
type ImageMetaData ¶
type ImageMetaData struct {
OCIIndex *OCIIndex
DockerManifests []DockerManifest
OCIManifests []OCIManifest
Configs []ImageConfig
RawConfigs [][]byte
Layers []OCIDescriptor
DiffIDs []string
RawManifest []byte
// contains filtered or unexported fields
}
type ImageSummary ¶
type OCIDescriptor ¶
type OCIIndex ¶
type OCIIndex struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType,omitempty"`
Manifests []OCIIndexManifest `json:"manifests"`
Annotations map[string]string `json:"annotations,omitempty"`
}
type OCIIndexManifest ¶
type OCIManifest ¶
type OCIManifest struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType,omitempty"`
Config OCIDescriptor `json:"config"`
Layers []OCIDescriptor `json:"layers"`
Annotations map[string]string `json:"annotations,omitempty"`
}
type OCIPlatform ¶
type Store ¶
type Store interface {
CheckImageExist(image *kii.ImageName) bool
MountImage(image *kii.ImageName, workingDir, targetDir string) error
UmountImage(workingDir string) error
GetImageManifest(image *kii.ImageName, auth *runtimeapi.AuthConfig) (*kii.Manifest, error)
TagImage(sourceImage, targetImage *kii.ImageName) error
LoadImage(tarFile string) error
RegisterImage(image, manifest string) error
PullImage(image string, auth *runtimeapi.AuthConfig) error
ListImage() ([]*Image, error)
RemoveImage(imageNameOrIDs []string) error
}
func NewDockerStore ¶
type TarReader ¶
type TarReader struct {
// contains filtered or unexported fields
}
*
- TarReader provides methods to extract files from tar/gzip streams, with cache for non-layer blobs.
- The file handle is passed in from the caller and its lifecycle is managed externally.
func (*TarReader) ExtractFileAsStream ¶
func (tr *TarReader) ExtractFileAsStream(filePath string) (io.ReadCloser, error)
type TarfileOsArchUnsupportedError ¶
type TarfileOsArchUnsupportedError struct {
Source string
CurrentPlatform string
ArchSummary []ImageSummary
Cause error
}
func (*TarfileOsArchUnsupportedError) Error ¶
func (e *TarfileOsArchUnsupportedError) Error() string
func (*TarfileOsArchUnsupportedError) Unwrap ¶
func (e *TarfileOsArchUnsupportedError) Unwrap() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.