changing log level

This commit is contained in:
Prashant Arya 2019-11-26 17:52:11 +00:00
parent e0e59e619c
commit 857715012f
5 changed files with 11 additions and 13 deletions

2
Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM alpine:latest
Run echo "prashant.arya"

BIN
context.tar.gz Normal file

Binary file not shown.

View File

@ -134,7 +134,7 @@ func (s *Snapshotter) scanFullFilesystem() ([]string, []string, error) {
Callback: func(path string, ent *godirwalk.Dirent) error { Callback: func(path string, ent *godirwalk.Dirent) error {
if util.IsInWhitelist(path) { if util.IsInWhitelist(path) {
if util.IsDestDir(path) { if util.IsDestDir(path) {
logrus.Debugf("Skipping paths under %s, as it is a whitelisted directory", path) logrus.Tracef("Skipping paths under %s, as it is a whitelisted directory", path)
return filepath.SkipDir return filepath.SkipDir
} }
return nil return nil
@ -170,7 +170,7 @@ func (s *Snapshotter) scanFullFilesystem() ([]string, []string, error) {
filesToAdd := []string{} filesToAdd := []string{}
for path := range memFs { for path := range memFs {
if util.CheckWhitelist(path) { if util.CheckWhitelist(path) {
logrus.Debugf("Not adding %s to layer, as it's whitelisted", path) logrus.Tracef("Not adding %s to layer, as it's whitelisted", path)
continue continue
} }
// Only add changed files. // Only add changed files.
@ -179,7 +179,7 @@ func (s *Snapshotter) scanFullFilesystem() ([]string, []string, error) {
return nil, nil, err return nil, nil, err
} }
if fileChanged { if fileChanged {
logrus.Debugf("Adding %s to layer, because it was changed.", path) logrus.Tracef("Adding %s to layer, because it was changed.", path)
filesToAdd = append(filesToAdd, path) filesToAdd = append(filesToAdd, path)
} }
} }

View File

@ -206,7 +206,7 @@ func extractFile(dest string, hdr *tar.Header, tr io.Reader) error {
} }
switch hdr.Typeflag { switch hdr.Typeflag {
case tar.TypeReg: case tar.TypeReg:
logrus.Debugf("creating file %s", path) logrus.Tracef("creating file %s", path)
// It's possible a file is in the tar before its directory, // It's possible a file is in the tar before its directory,
// or a file was copied over a directory prior to now // or a file was copied over a directory prior to now
fi, err := os.Stat(dir) fi, err := os.Stat(dir)
@ -496,7 +496,7 @@ func CopyDir(src, dest, buildcontext string) ([]string, error) {
} }
destPath := filepath.Join(dest, file) destPath := filepath.Join(dest, file)
if fi.IsDir() { if fi.IsDir() {
logrus.Debugf("Creating directory %s", destPath) logrus.Tracef("Creating directory %s", destPath)
mode := fi.Mode() mode := fi.Mode()
uid := int(fi.Sys().(*syscall.Stat_t).Uid) uid := int(fi.Sys().(*syscall.Stat_t).Uid)

View File

@ -29,15 +29,11 @@ if [[ ! -z "$4" ]]; then
cache=$4 cache=$4
fi fi
if [[ ! -e $HOME/.config/gcloud/application_default_credentials.json ]]; then
echo "Application Default Credentials do not exist. Run [gcloud auth application-default login] to configure them"
exit 1
fi
docker run \ docker run \
-v "$HOME"/.config/gcloud:/root/.config/gcloud \
-v "$context":/workspace \ -v "$context":/workspace \
gcr.io/kaniko-project/executor:latest \ docker.io/prary2/kaniko \
--dockerfile "${dockerfile}" --destination "${destination}" --context dir:///workspace/ \ --dockerfile "${dockerfile}" --no-push --context dir:///workspace/ \
--cache="${cache}" --cache="${cache}" --verbosity=debug
#gcr.io/kaniko-project/executor:latest \