Documentation ¶
Index ¶
- Constants
- func CreateIntegrationTarball() (string, error)
- func FindDockerFiles(dir, dockerfilesPattern string) ([]string, error)
- func GetDockerImage(imageRepo, dockerfile string) string
- func GetKanikoImage(imageRepo, dockerfile string) string
- func GetVersionedKanikoImage(imageRepo, dockerfile string, version int) string
- func RunCommand(cmd *exec.Cmd, t *testing.T) []byte
- func RunCommandWithoutTest(cmd *exec.Cmd) ([]byte, error)
- func RunOnInterrupt(f func())
- type DockerFileBuilder
- func (d *DockerFileBuilder) BuildDockerImage(t *testing.T, imageRepo, dockerfilesPath, dockerfile, contextDir string) error
- func (d *DockerFileBuilder) BuildImage(t *testing.T, config *integrationTestConfig, ...) error
- func (d *DockerFileBuilder) BuildImageWithContext(t *testing.T, config *integrationTestConfig, ...) error
Constants ¶
const ( // ExecutorImage is the name of the kaniko executor image ExecutorImage = "executor-image" //WarmerImage is the name of the kaniko cache warmer image WarmerImage = "warmer-image" )
Variables ¶
This section is empty.
Functions ¶
func CreateIntegrationTarball ¶
CreateIntegrationTarball will take the contents of the integration directory and write them to a tarball in a temmporary dir. It will return the path to the tarball.
func FindDockerFiles ¶
FindDockerFiles will look for test docker files in the directory dir and match the files against dockerfilesPattern. If the file is one we are intentionally skipping, it will not be included in the returned list.
func GetDockerImage ¶
GetDockerImage constructs the name of the docker image that would be built with dockerfile if it was tagged with imageRepo.
func GetKanikoImage ¶
GetKanikoImage constructs the name of the kaniko image that would be built with dockerfile if it was tagged with imageRepo.
func GetVersionedKanikoImage ¶ added in v0.4.0
GetVersionedKanikoImage versions constructs the name of the kaniko image that would be built with the dockerfile and versions it for cache testing
func RunCommand ¶
RunCommand will run cmd and if it fails will output relevant info for debugging before it fails. It must be run within the context of a test t and if the command fails, it will fail the test. Returns the output from the command.
func RunCommandWithoutTest ¶
RunCommandWithoutTest will run cmd and if it fails will output relevant info for debugging before returning an error. It can be run outside the context of a test.
func RunOnInterrupt ¶
func RunOnInterrupt(f func())
RunOnInterrupt will execute the function f if execution is interrupted with the interrupt signal.
Types ¶
type DockerFileBuilder ¶
type DockerFileBuilder struct { DockerfilesToIgnore map[string]struct{} TestCacheDockerfiles map[string]struct{} TestOCICacheDockerfiles map[string]struct{} // contains filtered or unexported fields }
DockerFileBuilder knows how to build docker files using both Kaniko and Docker and keeps track of which files have been built.
func NewDockerFileBuilder ¶
func NewDockerFileBuilder() *DockerFileBuilder
NewDockerFileBuilder will create a DockerFileBuilder initialized with dockerfiles, which it will assume are all as yet unbuilt.
func (*DockerFileBuilder) BuildDockerImage ¶ added in v0.19.0
func (d *DockerFileBuilder) BuildDockerImage(t *testing.T, imageRepo, dockerfilesPath, dockerfile, contextDir string) error
func (*DockerFileBuilder) BuildImage ¶
func (d *DockerFileBuilder) BuildImage(t *testing.T, config *integrationTestConfig, dockerfilesPath, dockerfile string) error
BuildImage will build dockerfile (located at dockerfilesPath) using both kaniko and docker. The resulting image will be tagged with imageRepo. If the dockerfile will be built with context (i.e. it is in `buildContextTests`) the context will be pulled from gcsBucket.
func (*DockerFileBuilder) BuildImageWithContext ¶ added in v0.18.0
func (d *DockerFileBuilder) BuildImageWithContext(t *testing.T, config *integrationTestConfig, dockerfilesPath, dockerfile, contextDir string) error