Documentation ¶
Overview ¶
Package image provides utilities to work with container images.
Index ¶
- Constants
- func GetImageDigestFromRef(ctx context.Context, imageRef, platform string, cache store.RefCacher) (*interfaces.EntityRef, error)
- type Parser
- func (_ *Parser) ConvertToEntityRef(reference string) (*interfaces.EntityRef, error)
- func (p *Parser) GetRegex() string
- func (p *Parser) Replace(ctx context.Context, matchedLine string, _ interfaces.REST, cfg config.Config) (*interfaces.EntityRef, error)
- func (p *Parser) SetCache(cache store.RefCacher)
- func (p *Parser) SetRegex(regex string)
Constants ¶
View Source
const ( // ContainerImageRegex is regular expression pattern to match container image usage in YAML // nolint:lll ContainerImageRegex = `` /* 149-byte string literal not displayed */ // ReferenceType is the type of the reference ReferenceType = "container" )
Variables ¶
This section is empty.
Functions ¶
func GetImageDigestFromRef ¶
func GetImageDigestFromRef(ctx context.Context, imageRef, platform string, cache store.RefCacher) (*interfaces.EntityRef, error)
GetImageDigestFromRef returns the digest of a container image reference from a name.Reference.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a struct to replace container image references with digests
func (*Parser) ConvertToEntityRef ¶
func (_ *Parser) ConvertToEntityRef(reference string) (*interfaces.EntityRef, error)
ConvertToEntityRef converts a container image reference to an EntityRef
func (*Parser) GetRegex ¶
GetRegex returns the regular expression pattern to match container image usage
func (*Parser) Replace ¶
func (p *Parser) Replace( ctx context.Context, matchedLine string, _ interfaces.REST, cfg config.Config, ) (*interfaces.EntityRef, error)
Replace replaces the container image reference with the digest
Click to show internal directories.
Click to hide internal directories.