mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-19 02:10:35 +02:00
refactor to add unit tests
This commit is contained in:
@@ -26,13 +26,14 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/constants"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/moby/buildkit/frontend/dockerfile/instructions"
|
||||
"github.com/moby/buildkit/frontend/dockerfile/parser"
|
||||
"github.com/moby/buildkit/frontend/dockerfile/shell"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/config"
|
||||
)
|
||||
|
||||
// for testing
|
||||
@@ -145,7 +146,7 @@ func matchSources(srcs, files []string) ([]string, error) {
|
||||
src = filepath.Clean(src)
|
||||
for _, file := range files {
|
||||
if filepath.IsAbs(src) {
|
||||
file = filepath.Join(constants.RootDir, file)
|
||||
file = filepath.Join(config.RootDir, file)
|
||||
}
|
||||
matched, err := filepath.Match(src, file)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user