mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 02:33:44 +02:00
Prevent extra snapshot with --use-new-run (#2943)
* Prevent extra snapshot when using new run * Add unit tests for initializing snapshotter There should be no snapshot for RunV2. Added a test for SingleSnapshot as well to prove that the test actually works (rather than `initialized` just not being read or set properly).
This commit is contained in:
@@ -29,15 +29,19 @@ import (
|
||||
)
|
||||
|
||||
type fakeSnapShotter struct {
|
||||
file string
|
||||
tarPath string
|
||||
file string
|
||||
tarPath string
|
||||
initialized bool
|
||||
}
|
||||
|
||||
func (f fakeSnapShotter) Init() error { return nil }
|
||||
func (f fakeSnapShotter) TakeSnapshotFS() (string, error) {
|
||||
func (f *fakeSnapShotter) Init() error {
|
||||
f.initialized = true
|
||||
return nil
|
||||
}
|
||||
func (f *fakeSnapShotter) TakeSnapshotFS() (string, error) {
|
||||
return f.tarPath, nil
|
||||
}
|
||||
func (f fakeSnapShotter) TakeSnapshot(_ []string, _, _ bool) (string, error) {
|
||||
func (f *fakeSnapShotter) TakeSnapshot(_ []string, _, _ bool) (string, error) {
|
||||
return f.tarPath, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user