mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-17 23:35:47 +02:00
Fix linting errors
This commit is contained in:
@@ -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
|
||||
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)
|
||||
cwd := filepath.Dir(ex)
|
||||
|
||||
|
||||
@@ -244,11 +244,11 @@ func TestCache(t *testing.T) {
|
||||
t.Run("test_cache_"+dockerfile, func(t *testing.T) {
|
||||
cache := filepath.Join(config.imageRepo, "cache", fmt.Sprintf("%v", time.Now().UnixNano()))
|
||||
// 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)
|
||||
}
|
||||
// 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)
|
||||
}
|
||||
// Make sure both images are the same
|
||||
|
||||
Reference in New Issue
Block a user