Documentation ¶
Overview ¶
for use in tests
Index ¶
- Constants
- Variables
- func CalculateDependencies(stages []config.KanikoStage, opts *config.KanikoOptions, ...) (map[int][]string, error)
- func CheckPushPermissions(opts *config.KanikoOptions) error
- func DoBuild(opts *config.KanikoOptions) (v1.Image, error)
- func DoPush(image v1.Image, opts *config.KanikoOptions) error
- func ResolveCrossStageInstructions(stages []config.KanikoStage) map[string]string
- type CompositeCache
- type MockCachedDockerCommand
- func (m MockCachedDockerCommand) CacheCommand(image v1.Image) commands.DockerCommand
- func (m MockCachedDockerCommand) ExecuteCommand(c *v1.Config, args *dockerfile.BuildArgs) error
- func (m MockCachedDockerCommand) FilesToSnapshot() []string
- func (m MockCachedDockerCommand) FilesUsedFromContext(c *v1.Config, args *dockerfile.BuildArgs) ([]string, error)
- func (m MockCachedDockerCommand) IsArgsEnvsRequiredInCache() bool
- func (m MockCachedDockerCommand) MetadataOnly() bool
- func (m MockCachedDockerCommand) ProvidesFilesToSnapshot() bool
- func (m MockCachedDockerCommand) RequiresUnpackedFS() bool
- func (m MockCachedDockerCommand) ShouldCacheOutput() bool
- func (m MockCachedDockerCommand) ShouldDetectDeletedFiles() bool
- func (m MockCachedDockerCommand) String() string
- type MockDockerCommand
- func (m MockDockerCommand) CacheCommand(image v1.Image) commands.DockerCommand
- func (m MockDockerCommand) ExecuteCommand(c *v1.Config, args *dockerfile.BuildArgs) error
- func (m MockDockerCommand) FilesToSnapshot() []string
- func (m MockDockerCommand) FilesUsedFromContext(c *v1.Config, args *dockerfile.BuildArgs) ([]string, error)
- func (m MockDockerCommand) IsArgsEnvsRequiredInCache() bool
- func (m MockDockerCommand) MetadataOnly() bool
- func (m MockDockerCommand) ProvidesFilesToSnapshot() bool
- func (m MockDockerCommand) RequiresUnpackedFS() bool
- func (m MockDockerCommand) ShouldCacheOutput() bool
- func (m MockDockerCommand) ShouldDetectDeletedFiles() bool
- func (m MockDockerCommand) String() string
Constants ¶
const ( UpstreamClientUaKey = "UPSTREAM_CLIENT_TYPE" DummyDestination = "docker.io/unset-repo/unset-image-name" )
Variables ¶
var (
DummyDestinations = []string{DummyDestination}
)
for testing
Functions ¶
func CalculateDependencies ¶ added in v0.10.0
func CalculateDependencies(stages []config.KanikoStage, opts *config.KanikoOptions, stageNameToIdx map[string]string) (map[int][]string, error)
func CheckPushPermissions ¶ added in v0.10.0
func CheckPushPermissions(opts *config.KanikoOptions) error
CheckPushPermissions checks that the configured credentials can be used to push to every specified destination.
func DoBuild ¶
func DoBuild(opts *config.KanikoOptions) (v1.Image, error)
DoBuild executes building the Dockerfile
func DoPush ¶
func DoPush(image v1.Image, opts *config.KanikoOptions) error
DoPush is responsible for pushing image to the destinations specified in opts. A dummy destination would be set when --no-push is set to true and --tar-path is not empty with empty --destinations.
func ResolveCrossStageInstructions ¶ added in v0.20.0
func ResolveCrossStageInstructions(stages []config.KanikoStage) map[string]string
iterates over a list of KanikoStage and resolves instructions referring to earlier stages returns a mapping of stage name to stage id, f.e - ["first": "0", "second": "1", "target": "2"]
Types ¶
type CompositeCache ¶ added in v0.5.0
type CompositeCache struct {
// contains filtered or unexported fields
}
CompositeCache is a type that generates a cache key from a series of keys.
func NewCompositeCache ¶ added in v0.5.0
func NewCompositeCache(initial ...string) *CompositeCache
NewCompositeCache returns an initialized composite cache object.
func (*CompositeCache) AddKey ¶ added in v0.5.0
func (s *CompositeCache) AddKey(k ...string)
AddKey adds the specified key to the sequence.
func (*CompositeCache) AddPath ¶ added in v0.5.0
func (s *CompositeCache) AddPath(p string, context util.FileContext) error
func (*CompositeCache) Hash ¶ added in v0.5.0
func (s *CompositeCache) Hash() (string, error)
Hash returns the composite key in a string SHA256 format.
func (*CompositeCache) Key ¶ added in v0.5.0
func (s *CompositeCache) Key() string
Key returns the human readable composite key as a string.
type MockCachedDockerCommand ¶ added in v0.15.0
type MockCachedDockerCommand struct {
// contains filtered or unexported fields
}
func (MockCachedDockerCommand) CacheCommand ¶ added in v0.15.0
func (m MockCachedDockerCommand) CacheCommand(image v1.Image) commands.DockerCommand
func (MockCachedDockerCommand) ExecuteCommand ¶ added in v0.15.0
func (m MockCachedDockerCommand) ExecuteCommand(c *v1.Config, args *dockerfile.BuildArgs) error
func (MockCachedDockerCommand) FilesToSnapshot ¶ added in v0.15.0
func (m MockCachedDockerCommand) FilesToSnapshot() []string
func (MockCachedDockerCommand) FilesUsedFromContext ¶ added in v0.15.0
func (m MockCachedDockerCommand) FilesUsedFromContext(c *v1.Config, args *dockerfile.BuildArgs) ([]string, error)
func (MockCachedDockerCommand) IsArgsEnvsRequiredInCache ¶ added in v1.12.0
func (m MockCachedDockerCommand) IsArgsEnvsRequiredInCache() bool
func (MockCachedDockerCommand) MetadataOnly ¶ added in v0.15.0
func (m MockCachedDockerCommand) MetadataOnly() bool
func (MockCachedDockerCommand) ProvidesFilesToSnapshot ¶ added in v0.20.0
func (m MockCachedDockerCommand) ProvidesFilesToSnapshot() bool
func (MockCachedDockerCommand) RequiresUnpackedFS ¶ added in v0.15.0
func (m MockCachedDockerCommand) RequiresUnpackedFS() bool
func (MockCachedDockerCommand) ShouldCacheOutput ¶ added in v0.15.0
func (m MockCachedDockerCommand) ShouldCacheOutput() bool
func (MockCachedDockerCommand) ShouldDetectDeletedFiles ¶ added in v0.24.0
func (m MockCachedDockerCommand) ShouldDetectDeletedFiles() bool
func (MockCachedDockerCommand) String ¶ added in v0.15.0
func (m MockCachedDockerCommand) String() string
type MockDockerCommand ¶ added in v0.15.0
type MockDockerCommand struct {
// contains filtered or unexported fields
}
func (MockDockerCommand) CacheCommand ¶ added in v0.15.0
func (m MockDockerCommand) CacheCommand(image v1.Image) commands.DockerCommand
func (MockDockerCommand) ExecuteCommand ¶ added in v0.15.0
func (m MockDockerCommand) ExecuteCommand(c *v1.Config, args *dockerfile.BuildArgs) error
func (MockDockerCommand) FilesToSnapshot ¶ added in v0.15.0
func (m MockDockerCommand) FilesToSnapshot() []string
func (MockDockerCommand) FilesUsedFromContext ¶ added in v0.15.0
func (m MockDockerCommand) FilesUsedFromContext(c *v1.Config, args *dockerfile.BuildArgs) ([]string, error)
func (MockDockerCommand) IsArgsEnvsRequiredInCache ¶ added in v1.12.0
func (m MockDockerCommand) IsArgsEnvsRequiredInCache() bool
func (MockDockerCommand) MetadataOnly ¶ added in v0.15.0
func (m MockDockerCommand) MetadataOnly() bool
func (MockDockerCommand) ProvidesFilesToSnapshot ¶ added in v0.20.0
func (m MockDockerCommand) ProvidesFilesToSnapshot() bool
func (MockDockerCommand) RequiresUnpackedFS ¶ added in v0.15.0
func (m MockDockerCommand) RequiresUnpackedFS() bool
func (MockDockerCommand) ShouldCacheOutput ¶ added in v0.15.0
func (m MockDockerCommand) ShouldCacheOutput() bool
func (MockDockerCommand) ShouldDetectDeletedFiles ¶ added in v0.24.0
func (m MockDockerCommand) ShouldDetectDeletedFiles() bool
func (MockDockerCommand) String ¶ added in v0.15.0
func (m MockDockerCommand) String() string