@@ -40,6 +40,7 @@ import (
40
40
"github.com/pkg/errors"
41
41
"google.golang.org/api/option"
42
42
43
+ "github.com/GoogleContainerTools/kaniko/pkg/filesystem"
43
44
"github.com/GoogleContainerTools/kaniko/pkg/timing"
44
45
"github.com/GoogleContainerTools/kaniko/pkg/util"
45
46
"github.com/GoogleContainerTools/kaniko/pkg/util/bucket"
@@ -104,7 +105,7 @@ func launchTests(m *testing.M) (int, error) {
104
105
if err != nil {
105
106
return 1 , errors .Wrap (err , "failed to get bucket name from uri" )
106
107
}
107
- contextFile , err := os .Open (contextFilePath )
108
+ contextFile , err := filesystem . FS .Open (contextFilePath )
108
109
if err != nil {
109
110
return 1 , fmt .Errorf ("failed to read file at path %v: %w" , contextFilePath , err )
110
111
}
@@ -113,7 +114,7 @@ func launchTests(m *testing.M) (int, error) {
113
114
return 1 , errors .Wrap (err , "Failed to upload build context" )
114
115
}
115
116
116
- if err = os .Remove (contextFilePath ); err != nil {
117
+ if err = filesystem . FS .Remove (contextFilePath ); err != nil {
117
118
return 1 , errors .Wrap (err , fmt .Sprintf ("Failed to remove tarball at %s" , contextFilePath ))
118
119
}
119
120
@@ -1035,7 +1036,7 @@ func getLastLayerFiles(image string) ([]string, error) {
1035
1036
1036
1037
func logBenchmarks (benchmark string ) error {
1037
1038
if b , err := strconv .ParseBool (os .Getenv ("BENCHMARK" )); err == nil && b {
1038
- f , err := os .Create (benchmark )
1039
+ f , err := filesystem . FS .Create (benchmark )
1039
1040
if err != nil {
1040
1041
return err
1041
1042
}
@@ -1074,7 +1075,7 @@ func initIntegrationTestConfig() *integrationTestConfig {
1074
1075
if err != nil {
1075
1076
log .Fatalf ("Error getting absolute path for service account: %s\n " , c .serviceAccount )
1076
1077
}
1077
- if _ , err := os .Stat (absPath ); os .IsNotExist (err ) {
1078
+ if _ , err := filesystem . FS .Stat (absPath ); os .IsNotExist (err ) {
1078
1079
log .Fatalf ("Service account does not exist: %s\n " , absPath )
1079
1080
}
1080
1081
c .serviceAccount = absPath
0 commit comments