Documentation ¶
Index ¶
- Constants
- func DirExists(d string) bool
- func IsSupportedMediaType(mediaType string) bool
- func ValidateHardLink(rootDir string) error
- type Blob
- type BlobUpload
- type Cache
- type ImageStore
- type ImageStoreLocal
- func (is *ImageStoreLocal) BlobPath(repo string, digest godigest.Digest) string
- func (is *ImageStoreLocal) BlobUploadInfo(repo, uuid string) (int64, error)
- func (is *ImageStoreLocal) BlobUploadPath(repo, uuid string) string
- func (is *ImageStoreLocal) CheckBlob(repo, digest string) (bool, int64, error)
- func (is *ImageStoreLocal) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error
- func (is *ImageStoreLocal) DeleteBlob(repo, digest string) error
- func (is *ImageStoreLocal) DeleteBlobUpload(repo, uuid string) error
- func (is *ImageStoreLocal) DeleteImageManifest(repo, reference string) error
- func (is *ImageStoreLocal) DirExists(d string) bool
- func (is *ImageStoreLocal) FinishBlobUpload(repo, uuid string, body io.Reader, digest string) error
- func (is *ImageStoreLocal) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
- func (is *ImageStoreLocal) GetBlob(repo, digest, mediaType string) (io.ReadCloser, int64, error)
- func (is *ImageStoreLocal) GetBlobContent(repo, digest string) ([]byte, error)
- func (is *ImageStoreLocal) GetBlobPartial(repo, digest, mediaType string, from, to int64) (io.ReadCloser, int64, int64, error)
- func (is *ImageStoreLocal) GetBlobUpload(repo, uuid string) (int64, error)
- func (is *ImageStoreLocal) GetImageManifest(repo, reference string) ([]byte, string, string, error)
- func (is *ImageStoreLocal) GetImageTags(repo string) ([]string, error)
- func (is *ImageStoreLocal) GetIndexContent(repo string) ([]byte, error)
- func (is *ImageStoreLocal) GetNextRepository(repo string) (string, error)
- func (is *ImageStoreLocal) GetReferrers(repo, digest, artifactType string) ([]artifactspec.Descriptor, error)
- func (is *ImageStoreLocal) GetRepositories() ([]string, error)
- func (is *ImageStoreLocal) InitRepo(name string) error
- func (is *ImageStoreLocal) Lock(lockStart *time.Time)
- func (is *ImageStoreLocal) NewBlobUpload(repo string) (string, error)
- func (is *ImageStoreLocal) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader) (int64, error)
- func (is *ImageStoreLocal) PutBlobChunkStreamed(repo, uuid string, body io.Reader) (int64, error)
- func (is *ImageStoreLocal) PutImageManifest(repo, reference, mediaType string, body []byte) (string, error)
- func (is *ImageStoreLocal) RLock(lockStart *time.Time)
- func (is *ImageStoreLocal) RUnlock(lockStart *time.Time)
- func (is *ImageStoreLocal) RootDir() string
- func (is *ImageStoreLocal) RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler)
- func (is *ImageStoreLocal) RunGCRepo(repo string) error
- func (is *ImageStoreLocal) Unlock(lockStart *time.Time)
- func (is *ImageStoreLocal) ValidateRepo(name string) (bool, error)
- type Lint
- type ScrubImageResult
- type ScrubResults
- type StoreController
Constants ¶
const ( // global bucket. BlobsCache = "blobs" // bucket where we store all blobs from storage(deduped blobs + original blob). DuplicatesBucket = "duplicates" /* bucket where we store only the original/source blob (used by s3 to know which is the blob with content) it should contain only one blob, this is the only place from which we'll get blobs. */ OriginalBucket = "original" DBExtensionName = ".db" )
const ( // BlobUploadDir defines the upload directory for blob uploads. BlobUploadDir = ".uploads" SchemaVersion = 2 DefaultFilePerms = 0o600 DefaultDirPerms = 0o700 RLOCK = "RLock" RWLOCK = "RWLock" )
const ( S3StorageDriverName = "s3" DefaultGCDelay = 1 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func IsSupportedMediaType ¶
func ValidateHardLink ¶
Types ¶
type BlobUpload ¶
BlobUpload models and upload request.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) DeleteBlob ¶
type ImageStore ¶
type ImageStore interface { DirExists(d string) bool RootDir() string RLock(*time.Time) RUnlock(*time.Time) Lock(*time.Time) Unlock(*time.Time) InitRepo(name string) error ValidateRepo(name string) (bool, error) GetRepositories() ([]string, error) GetNextRepository(repo string) (string, error) GetImageTags(repo string) ([]string, error) GetImageManifest(repo, reference string) ([]byte, string, string, error) PutImageManifest(repo, reference, mediaType string, body []byte) (string, error) DeleteImageManifest(repo, reference string) error BlobUploadPath(repo, uuid string) string NewBlobUpload(repo string) (string, error) GetBlobUpload(repo, uuid string) (int64, error) PutBlobChunkStreamed(repo, uuid string, body io.Reader) (int64, error) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader) (int64, error) BlobUploadInfo(repo, uuid string) (int64, error) FinishBlobUpload(repo, uuid string, body io.Reader, digest string) error FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error) DedupeBlob(src string, dstDigest digest.Digest, dst string) error DeleteBlobUpload(repo, uuid string) error BlobPath(repo string, digest digest.Digest) string CheckBlob(repo, digest string) (bool, int64, error) GetBlob(repo, digest, mediaType string) (io.ReadCloser, int64, error) GetBlobPartial(repo, digest, mediaType string, from, to int64) (io.ReadCloser, int64, int64, error) DeleteBlob(repo, digest string) error GetIndexContent(repo string) ([]byte, error) GetBlobContent(repo, digest string) ([]byte, error) GetReferrers(repo, digest string, mediaType string) ([]artifactspec.Descriptor, error) RunGCRepo(repo string) error RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler) }
func NewImageStore ¶
func NewImageStore(rootDir string, gc bool, gcDelay time.Duration, dedupe, commit bool, log zlog.Logger, metrics monitoring.MetricServer, linter Lint, ) ImageStore
NewImageStore returns a new image store backed by a file storage.
type ImageStoreLocal ¶ added in v1.4.2
type ImageStoreLocal struct {
// contains filtered or unexported fields
}
ImageStoreLocal provides the image storage operations.
func (*ImageStoreLocal) BlobPath ¶ added in v1.4.2
func (is *ImageStoreLocal) BlobPath(repo string, digest godigest.Digest) string
BlobPath returns the repository path of a blob.
func (*ImageStoreLocal) BlobUploadInfo ¶ added in v1.4.2
func (is *ImageStoreLocal) BlobUploadInfo(repo, uuid string) (int64, error)
BlobUploadInfo returns the current blob size in bytes.
func (*ImageStoreLocal) BlobUploadPath ¶ added in v1.4.2
func (is *ImageStoreLocal) BlobUploadPath(repo, uuid string) string
BlobUploadPath returns the upload path for a blob in this store.
func (*ImageStoreLocal) CheckBlob ¶ added in v1.4.2
func (is *ImageStoreLocal) CheckBlob(repo, digest string) (bool, int64, error)
CheckBlob verifies a blob and returns true if the blob is correct.
func (*ImageStoreLocal) DedupeBlob ¶ added in v1.4.2
func (*ImageStoreLocal) DeleteBlob ¶ added in v1.4.2
func (is *ImageStoreLocal) DeleteBlob(repo, digest string) error
DeleteBlob removes the blob from the repository.
func (*ImageStoreLocal) DeleteBlobUpload ¶ added in v1.4.2
func (is *ImageStoreLocal) DeleteBlobUpload(repo, uuid string) error
DeleteBlobUpload deletes an existing blob upload that is currently in progress.
func (*ImageStoreLocal) DeleteImageManifest ¶ added in v1.4.2
func (is *ImageStoreLocal) DeleteImageManifest(repo, reference string) error
DeleteImageManifest deletes the image manifest from the repository.
func (*ImageStoreLocal) DirExists ¶ added in v1.4.2
func (is *ImageStoreLocal) DirExists(d string) bool
func (*ImageStoreLocal) FinishBlobUpload ¶ added in v1.4.2
FinishBlobUpload finalizes the blob upload and moves blob the repository.
func (*ImageStoreLocal) FullBlobUpload ¶ added in v1.4.2
func (is *ImageStoreLocal) FullBlobUpload(repo string, body io.Reader, digest string) (string, int64, error)
FullBlobUpload handles a full blob upload, and no partial session is created.
func (*ImageStoreLocal) GetBlob ¶ added in v1.4.2
func (is *ImageStoreLocal) GetBlob(repo, digest, mediaType string) (io.ReadCloser, int64, error)
GetBlob returns a stream to read the blob. blob selector instead of directly downloading the blob.
func (*ImageStoreLocal) GetBlobContent ¶ added in v1.4.2
func (is *ImageStoreLocal) GetBlobContent(repo, digest string) ([]byte, error)
func (*ImageStoreLocal) GetBlobPartial ¶ added in v1.4.2
func (is *ImageStoreLocal) GetBlobPartial(repo, digest, mediaType string, from, to int64, ) (io.ReadCloser, int64, int64, error)
GetBlobPartial returns a partial stream to read the blob. blob selector instead of directly downloading the blob.
func (*ImageStoreLocal) GetBlobUpload ¶ added in v1.4.2
func (is *ImageStoreLocal) GetBlobUpload(repo, uuid string) (int64, error)
GetBlobUpload returns the current size of a blob upload.
func (*ImageStoreLocal) GetImageManifest ¶ added in v1.4.2
GetImageManifest returns the image manifest of an image in the specific repository.
func (*ImageStoreLocal) GetImageTags ¶ added in v1.4.2
func (is *ImageStoreLocal) GetImageTags(repo string) ([]string, error)
GetImageTags returns a list of image tags available in the specified repository.
func (*ImageStoreLocal) GetIndexContent ¶ added in v1.4.2
func (is *ImageStoreLocal) GetIndexContent(repo string) ([]byte, error)
func (*ImageStoreLocal) GetNextRepository ¶
func (is *ImageStoreLocal) GetNextRepository(repo string) (string, error)
GetNextRepository returns next repository under this store.
func (*ImageStoreLocal) GetReferrers ¶ added in v1.4.2
func (is *ImageStoreLocal) GetReferrers(repo, digest, artifactType string) ([]artifactspec.Descriptor, error)
func (*ImageStoreLocal) GetRepositories ¶ added in v1.4.2
func (is *ImageStoreLocal) GetRepositories() ([]string, error)
GetRepositories returns a list of all the repositories under this store.
func (*ImageStoreLocal) InitRepo ¶ added in v1.4.2
func (is *ImageStoreLocal) InitRepo(name string) error
InitRepo creates an image repository under this store.
func (*ImageStoreLocal) Lock ¶ added in v1.4.2
func (is *ImageStoreLocal) Lock(lockStart *time.Time)
Lock write-lock.
func (*ImageStoreLocal) NewBlobUpload ¶ added in v1.4.2
func (is *ImageStoreLocal) NewBlobUpload(repo string) (string, error)
NewBlobUpload returns the unique ID for an upload in progress.
func (*ImageStoreLocal) PutBlobChunk ¶ added in v1.4.2
func (is *ImageStoreLocal) PutBlobChunk(repo, uuid string, from, to int64, body io.Reader, ) (int64, error)
PutBlobChunk writes another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ImageStoreLocal) PutBlobChunkStreamed ¶ added in v1.4.2
PutBlobChunkStreamed appends another chunk of data to the specified blob. It returns the number of actual bytes to the blob.
func (*ImageStoreLocal) PutImageManifest ¶ added in v1.4.2
func (is *ImageStoreLocal) PutImageManifest(repo, reference, mediaType string, body []byte, ) (string, error)
PutImageManifest adds an image manifest to the repository.
func (*ImageStoreLocal) RLock ¶ added in v1.4.2
func (is *ImageStoreLocal) RLock(lockStart *time.Time)
RLock read-lock.
func (*ImageStoreLocal) RUnlock ¶ added in v1.4.2
func (is *ImageStoreLocal) RUnlock(lockStart *time.Time)
RUnlock read-unlock.
func (*ImageStoreLocal) RootDir ¶ added in v1.4.2
func (is *ImageStoreLocal) RootDir() string
func (*ImageStoreLocal) RunGCPeriodically ¶
func (is *ImageStoreLocal) RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler)
func (*ImageStoreLocal) RunGCRepo ¶ added in v1.4.2
func (is *ImageStoreLocal) RunGCRepo(repo string) error
func (*ImageStoreLocal) Unlock ¶ added in v1.4.2
func (is *ImageStoreLocal) Unlock(lockStart *time.Time)
Unlock write-unlock.
func (*ImageStoreLocal) ValidateRepo ¶ added in v1.4.2
func (is *ImageStoreLocal) ValidateRepo(name string) (bool, error)
ValidateRepo validates that the repository layout is complaint with the OCI repo layout.
type ScrubImageResult ¶ added in v1.3.6
type ScrubImageResult struct { ImageName string `json:"imageName"` Tag string `json:"tag"` Status string `json:"status"` Error string `json:"error"` }
func CheckImageStoreBlobsIntegrity ¶ added in v1.4.0
func CheckImageStoreBlobsIntegrity(imgStore ImageStore) ([]ScrubImageResult, error)
func CheckRepo ¶ added in v1.4.1
func CheckRepo(imageName string, imgStore ImageStore) ([]ScrubImageResult, error)
type ScrubResults ¶ added in v1.3.6
type ScrubResults struct {
ScrubResults []ScrubImageResult `json:"scrubResults"`
}
func (ScrubResults) PrintScrubResults ¶ added in v1.3.6
func (results ScrubResults) PrintScrubResults(resultWriter io.Writer)
type StoreController ¶
type StoreController struct { DefaultStore ImageStore SubStore map[string]ImageStore }
func (StoreController) CheckAllBlobsIntegrity ¶ added in v1.3.6
func (sc StoreController) CheckAllBlobsIntegrity() (ScrubResults, error)
func (StoreController) GetImageStore ¶
func (sc StoreController) GetImageStore(name string) ImageStore