Documentation ¶
Index ¶
- Constants
- func ApplyLinter(imgStore ImageStore, linter Lint, repo string, manifestDesc ispec.Descriptor) (bool, error)
- func CheckIfIndexNeedsUpdate(index *ispec.Index, desc *ispec.Descriptor, log zerolog.Logger) (bool, godigest.Digest, error)
- func Create(dbtype string, parameters interface{}, log zlog.Logger) (cache.Cache, error)
- func GetAndValidateRequestDigest(body []byte, digestStr string, log zerolog.Logger) (godigest.Digest, error)
- func GetIndex(imgStore ImageStore, repo string, log zerolog.Logger) (ispec.Index, error)
- func GetManifestDescByReference(index ispec.Index, reference string) (ispec.Descriptor, bool)
- func GetOrasReferrers(imgStore ImageStore, repo string, gdigest godigest.Digest, artifactType string, ...) ([]oras.Descriptor, error)
- func GetReferrers(imgStore ImageStore, repo string, gdigest godigest.Digest, artifactType string, ...) (ispec.Index, error)
- func GetTagsByIndex(index ispec.Index) []string
- func IsSupportedMediaType(mediaType string) bool
- func PruneImageManifestsFromIndex(imgStore ImageStore, repo string, digest godigest.Digest, outIndex ispec.Index, ...) ([]ispec.Descriptor, error)
- func RemoveManifestDescByReference(index *ispec.Index, reference string, detectCollisions bool) (ispec.Descriptor, bool, error)
- func UpdateIndexWithPrunedImageManifests(imgStore ImageStore, index *ispec.Index, repo string, desc ispec.Descriptor, ...) error
- func ValidateManifest(imgStore ImageStore, repo, reference, mediaType string, body []byte, ...) (godigest.Digest, error)
- type BlobUpload
- type ImageStore
- type Lint
- type ScrubImageResult
- type ScrubResults
- type StoreController
Constants ¶
const ( S3StorageDriverName = "s3" DefaultGCDelay = 1 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func ApplyLinter ¶ added in v1.4.3
func ApplyLinter(imgStore ImageStore, linter Lint, repo string, manifestDesc ispec.Descriptor) (bool, error)
func CheckIfIndexNeedsUpdate ¶ added in v1.4.3
func CheckIfIndexNeedsUpdate(index *ispec.Index, desc *ispec.Descriptor, log zerolog.Logger, ) (bool, godigest.Digest, error)
CheckIfIndexNeedsUpdate verifies if an index needs to be updated given a new manifest descriptor.
Returns whether or not index needs update, in the latter case it will also return the previous digest.
func GetAndValidateRequestDigest ¶ added in v1.4.3
func GetManifestDescByReference ¶ added in v1.4.3
func GetOrasReferrers ¶ added in v1.4.3
func GetOrasReferrers(imgStore ImageStore, repo string, gdigest godigest.Digest, artifactType string, log zerolog.Logger, ) ([]oras.Descriptor, error)
func GetReferrers ¶ added in v1.4.3
func GetTagsByIndex ¶ added in v1.4.3
func IsSupportedMediaType ¶
func PruneImageManifestsFromIndex ¶ added in v1.4.3
func PruneImageManifestsFromIndex(imgStore ImageStore, repo string, digest godigest.Digest, outIndex ispec.Index, otherImgIndexes []ispec.Descriptor, log zerolog.Logger, ) ([]ispec.Descriptor, error)
Before an image index manifest is pushed to a repo, its constituent manifests are pushed first, so when updating/removing this image index manifest, we also need to determine if there are other image index manifests which refer to the same constitutent manifests so that they can be garbage-collected correctly
PruneImageManifestsFromIndex is a helper routine to achieve this.
func RemoveManifestDescByReference ¶ added in v1.4.3
func UpdateIndexWithPrunedImageManifests ¶ added in v1.4.3
func UpdateIndexWithPrunedImageManifests(imgStore ImageStore, index *ispec.Index, repo string, desc ispec.Descriptor, oldDgst godigest.Digest, log zerolog.Logger, ) error
Unmarshal an image index and for all manifests in that index, ensure that they do not have a name or they are not in other manifest indexes else GC can never clean them.
func ValidateManifest ¶ added in v1.4.3
Types ¶
type BlobUpload ¶
BlobUpload models and upload request.
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, godigest.Digest, string, error) PutImageManifest(repo, reference, mediaType string, body []byte) (godigest.Digest, error) DeleteImageManifest(repo, reference string, detectCollision bool) 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 godigest.Digest) error FullBlobUpload(repo string, body io.Reader, digest godigest.Digest) (string, int64, error) DedupeBlob(src string, dstDigest godigest.Digest, dst string) error DeleteBlobUpload(repo, uuid string) error BlobPath(repo string, digest godigest.Digest) string CheckBlob(repo string, digest godigest.Digest) (bool, int64, error) GetBlob(repo string, digest godigest.Digest, mediaType string) (io.ReadCloser, int64, error) GetBlobPartial(repo string, digest godigest.Digest, mediaType string, from, to int64, ) (io.ReadCloser, int64, int64, error) DeleteBlob(repo string, digest godigest.Digest) error GetIndexContent(repo string) ([]byte, error) GetBlobContent(repo string, digest godigest.Digest) ([]byte, error) GetReferrers(repo string, digest godigest.Digest, artifactType string) (ispec.Index, error) GetOrasReferrers(repo string, digest godigest.Digest, artifactType string) ([]artifactspec.Descriptor, error) RunGCRepo(repo string) error RunGCPeriodically(interval time.Duration, sch *scheduler.Scheduler) }
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