integration

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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

func CreateIntegrationTarball() (string, error)

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

func FindDockerFiles(dir, dockerfilesPattern string) ([]string, error)

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

func GetDockerImage(imageRepo, dockerfile string) string

GetDockerImage constructs the name of the docker image that would be built with dockerfile if it was tagged with imageRepo.

func GetKanikoImage

func GetKanikoImage(imageRepo, dockerfile string) string

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

func GetVersionedKanikoImage(imageRepo, dockerfile string, version int) string

GetVersionedKanikoImage versions constructs the name of the kaniko image that would be built with the dockerfile and versions it for cache testing

func RunCommand

func RunCommand(cmd *exec.Cmd, t *testing.T) []byte

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

func RunCommandWithoutTest(cmd *exec.Cmd) ([]byte, error)

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

Jump to

Keyboard shortcuts

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