common

package
v1.4.2-rc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package common ...

Index

Constants

View Source
const (
	AnnotationLabels           = "org.label-schema.labels"
	LabelAnnotationCreated     = "org.label-schema.build-date"
	LabelAnnotationVendor      = "org.label-schema.vendor"
	LabelAnnotationDescription = "org.label-schema.description"
	LabelAnnotationLicenses    = "org.label-schema.license"
)

Variables

This section is empty.

Functions

func GetCategories

func GetCategories(labels map[string]string) string

func GetDescription

func GetDescription(labels map[string]string) string

func GetImageDirAndTag

func GetImageDirAndTag(imageName string) (string, string)

func GetLicense

func GetLicense(labels map[string]string) string

func GetRepo

func GetRepo(image string) string

func GetRootDir

func GetRootDir(image string, storeController storage.StoreController) string

func GetRoutePrefix

func GetRoutePrefix(name string) string

func GetVendor

func GetVendor(labels map[string]string) string

Types

type BaseOciLayoutUtils added in v1.4.2

type BaseOciLayoutUtils struct {
	Log             log.Logger
	StoreController storage.StoreController
}

OciLayoutInfo ...

func NewBaseOciLayoutUtils added in v1.4.2

func NewBaseOciLayoutUtils(storeController storage.StoreController, log log.Logger) *BaseOciLayoutUtils

NewBaseOciLayoutUtils initializes a new OciLayoutUtils object.

func (BaseOciLayoutUtils) CheckManifestSignature added in v1.4.2

func (olu BaseOciLayoutUtils) CheckManifestSignature(name string, digest godigest.Digest) bool

checks if manifest is signed or not checks for notary or cosign signature if cosign signature found it does not looks for notary signature.

func (BaseOciLayoutUtils) GetExpandedRepoInfo added in v1.4.2

func (olu BaseOciLayoutUtils) GetExpandedRepoInfo(name string) (RepoInfo, error)

func (BaseOciLayoutUtils) GetImageBlobManifest added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageBlobManifest(imageDir string, digest godigest.Digest) (v1.Manifest, error)

nolint: interfacer

func (BaseOciLayoutUtils) GetImageConfigInfo added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageConfigInfo(repo string, manifestDigest godigest.Digest) (ispec.Image, error)

func (BaseOciLayoutUtils) GetImageConfigSize added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageConfigSize(repo string, manifestDigest godigest.Digest) int64

func (BaseOciLayoutUtils) GetImageInfo added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageInfo(imageDir string, hash v1.Hash) (ispec.Image, error)

nolint: interfacer

func (BaseOciLayoutUtils) GetImageLastUpdated added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageLastUpdated(imageInfo ispec.Image) time.Time

func (BaseOciLayoutUtils) GetImageManifestSize added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageManifestSize(repo string, manifestDigest godigest.Digest) int64

func (BaseOciLayoutUtils) GetImageManifests added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageManifests(image string) ([]ispec.Descriptor, error)

Below method will return image path including root dir, root dir is determined by splitting.

func (BaseOciLayoutUtils) GetImagePlatform added in v1.4.2

func (olu BaseOciLayoutUtils) GetImagePlatform(imageConfig ispec.Image) (
	string, string,
)

func (BaseOciLayoutUtils) GetImageTagsWithTimestamp added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageTagsWithTimestamp(repo string) ([]TagInfo, error)

GetImageTagsWithTimestamp returns a list of image tags with timestamp available in the specified repository.

func (BaseOciLayoutUtils) GetImageVendor added in v1.4.2

func (olu BaseOciLayoutUtils) GetImageVendor(imageConfig ispec.Image) string

func (BaseOciLayoutUtils) GetRepoLastUpdated added in v1.4.2

func (olu BaseOciLayoutUtils) GetRepoLastUpdated(repo string) (TagInfo, error)

func (BaseOciLayoutUtils) IsValidImageFormat added in v1.4.2

func (olu BaseOciLayoutUtils) IsValidImageFormat(image string) (bool, error)

type Image added in v1.4.2

type Image struct {
	Tag      string  `json:"tag"`
	Digest   string  `json:"digest"`
	IsSigned bool    `json:"isSigned"`
	Layers   []Layer `json:"layers"`
}

type Layer added in v1.3.8

type Layer struct {
	Size   string `json:"size"`
	Digest string `json:"digest"`
}

type OciLayoutUtils

type OciLayoutUtils interface {
	GetImageManifests(image string) ([]ispec.Descriptor, error)
	GetImageBlobManifest(imageDir string, digest godigest.Digest) (v1.Manifest, error)
	GetImageInfo(imageDir string, hash v1.Hash) (ispec.Image, error)
	IsValidImageFormat(image string) (bool, error)
	GetImageTagsWithTimestamp(repo string) ([]TagInfo, error)
	GetImageLastUpdated(imageInfo ispec.Image) time.Time
	GetImagePlatform(imageInfo ispec.Image) (string, string)
	GetImageVendor(imageInfo ispec.Image) string
	GetImageManifestSize(repo string, manifestDigest godigest.Digest) int64
	GetRepoLastUpdated(repo string) (TagInfo, error)
	GetExpandedRepoInfo(name string) (RepoInfo, error)
	GetImageConfigInfo(repo string, manifestDigest godigest.Digest) (ispec.Image, error)
	CheckManifestSignature(name string, digest godigest.Digest) bool
}

type OsArch added in v1.4.2

type OsArch struct {
	Os   string `json:"os"`
	Arch string `json:"arch"`
}

type RepoInfo added in v1.3.8

type RepoInfo struct {
	Summary RepoSummary
	Images  []Image `json:"images"`
}

type RepoSummary added in v1.4.2

type RepoSummary struct {
	Name        string    `json:"name"`
	LastUpdated time.Time `json:"lastUpdated"`
	Size        string    `json:"size"`
	Platforms   []OsArch  `json:"platforms"`
	Vendors     []string  `json:"vendors"`
	Score       int       `json:"score"`
}

type TagInfo

type TagInfo struct {
	Name      string
	Digest    string
	Timestamp time.Time
}

func GetFixedTags

func GetFixedTags(allTags, infectedTags []TagInfo) []TagInfo

func GetLatestTag

func GetLatestTag(allTags []TagInfo) TagInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL