Fix linting errors
This commit is contained in:
parent
c216fbf91b
commit
eb7194a165
|
|
@ -204,7 +204,7 @@ func (d *DockerFileBuilder) BuildImage(imageRepo, gcsBucket, dockerfilesPath, do
|
||||||
}
|
}
|
||||||
|
|
||||||
// buildCachedImages builds the images for testing caching via kaniko where version is the nth time this image has been built
|
// buildCachedImages builds the images for testing caching via kaniko where version is the nth time this image has been built
|
||||||
func (d *DockerFileBuilder) buildCachedImages(imageRepo, cache, dockerfilesPath, dockerfile string, version int) error {
|
func (d *DockerFileBuilder) buildCachedImages(imageRepo, cache, dockerfilesPath string, version int) error {
|
||||||
_, ex, _, _ := runtime.Caller(0)
|
_, ex, _, _ := runtime.Caller(0)
|
||||||
cwd := filepath.Dir(ex)
|
cwd := filepath.Dir(ex)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -244,11 +244,11 @@ func TestCache(t *testing.T) {
|
||||||
t.Run("test_cache_"+dockerfile, func(t *testing.T) {
|
t.Run("test_cache_"+dockerfile, func(t *testing.T) {
|
||||||
cache := filepath.Join(config.imageRepo, "cache", fmt.Sprintf("%v", time.Now().UnixNano()))
|
cache := filepath.Join(config.imageRepo, "cache", fmt.Sprintf("%v", time.Now().UnixNano()))
|
||||||
// Build the initial image which will cache layers
|
// Build the initial image which will cache layers
|
||||||
if err := imageBuilder.buildCachedImages(config.imageRepo, cache, dockerfilesPath, dockerfile, 0); err != nil {
|
if err := imageBuilder.buildCachedImages(config.imageRepo, cache, dockerfilesPath, 0); err != nil {
|
||||||
t.Fatalf("error building cached image for the first time: %v", err)
|
t.Fatalf("error building cached image for the first time: %v", err)
|
||||||
}
|
}
|
||||||
// Build the second image which should pull from the cache
|
// Build the second image which should pull from the cache
|
||||||
if err := imageBuilder.buildCachedImages(config.imageRepo, cache, dockerfilesPath, dockerfile, 1); err != nil {
|
if err := imageBuilder.buildCachedImages(config.imageRepo, cache, dockerfilesPath, 1); err != nil {
|
||||||
t.Fatalf("error building cached image for the first time: %v", err)
|
t.Fatalf("error building cached image for the first time: %v", err)
|
||||||
}
|
}
|
||||||
// Make sure both images are the same
|
// Make sure both images are the same
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue