Skip to content

Commit

Permalink
np: Capitalize every log message
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed May 12, 2022
1 parent f4ff0eb commit 9676a69
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 90 deletions.
8 changes: 4 additions & 4 deletions cmd/executor/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var RootCmd = &cobra.Command{
if !force {
exit(errors.New("kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue"))
}
logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system")
logrus.Warn("Kaniko is being run outside of a container. This can have dangerous effects on your system")
}
if !opts.NoPush || opts.CacheRepo != "" {
if err := executor.CheckPushPermissions(opts); err != nil {
Expand Down Expand Up @@ -152,11 +152,11 @@ var RootCmd = &cobra.Command{
return
}
if strings.HasPrefix(benchmarkFile, "gs://") {
logrus.Info("uploading to gcs")
logrus.Info("Uploading to gcs")
if err := buildcontext.UploadToBucket(strings.NewReader(s), benchmarkFile); err != nil {
logrus.Infof("Unable to upload %s due to %v", benchmarkFile, err)
}
logrus.Infof("benchmark file written at %s", benchmarkFile)
logrus.Infof("Benchmark file written at %s", benchmarkFile)
} else {
f, err := os.Create(benchmarkFile)
if err != nil {
Expand All @@ -165,7 +165,7 @@ var RootCmd = &cobra.Command{
}
defer f.Close()
f.WriteString(s)
logrus.Infof("benchmark file written at %s", benchmarkFile)
logrus.Infof("Benchmark file written at %s", benchmarkFile)
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (cr *CachingCopyCommand) ExecuteCommand(config *v1.Config, buildArgs *docke
cr.layer = layers[0]
cr.extractedFiles, err = util.GetFSFromLayers(kConfig.RootDir, layers, util.ExtractFunc(cr.extractFn), util.IncludeWhiteout())

logrus.Debugf("extractedFiles: %s", cr.extractedFiles)
logrus.Debugf("ExtractedFiles: %s", cr.extractedFiles)
if err != nil {
return errors.Wrap(err, "extracting fs from image")
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func setupTestTemp(t *testing.T) string {

srcPath, err := filepath.Abs("../../integration/context")
if err != nil {
logrus.Fatalf("error getting abs path %s", srcPath)
logrus.Fatalf("Error getting abs path %s", srcPath)
}
cperr := filepath.Walk(srcPath,
func(path string, info os.FileInfo, err error) error {
Expand Down Expand Up @@ -98,7 +98,7 @@ func setupTestTemp(t *testing.T) string {
return nil
})
if cperr != nil {
logrus.Fatalf("error populating temp dir %s", cperr)
logrus.Fatalf("Error populating temp dir %s", cperr)
}

return tempDir
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestCopyExecuteCmd(t *testing.T) {
t.Error()
}
for _, file := range files {
logrus.Debugf("file: %v", file.Name())
logrus.Debugf("File: %v", file.Name())
dirList = append(dirList, file.Name())
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/expose.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ExposeCommand struct {
}

func (r *ExposeCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: EXPOSE")
logrus.Info("Cmd: EXPOSE")
// Grab the currently exposed ports
existingPorts := config.ExposedPorts
if existingPorts == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/onbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type OnBuildCommand struct {

//ExecuteCommand adds the specified expression in Onbuild to the config
func (o *OnBuildCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: ONBUILD")
logrus.Infof("args: %s", o.cmd.Expression)
logrus.Info("Cmd: ONBUILD")
logrus.Infof("Args: %s", o.cmd.Expression)
if config.OnBuild == nil {
config.OnBuild = []string{o.cmd.Expression}
} else {
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func runCommandInExec(config *v1.Config, buildArgs *dockerfile.BuildArgs, cmdRun
}
}

logrus.Infof("cmd: %s", newCommand[0])
logrus.Infof("args: %s", newCommand[1:])
logrus.Infof("Cmd: %s", newCommand[0])
logrus.Infof("Args: %s", newCommand[1:])

cmd := exec.Command(newCommand[0], newCommand[1:]...)

Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/run_marker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ type RunMarkerCommand struct {

func (r *RunMarkerCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
// run command `touch filemarker`
logrus.Debugf("using new RunMarker command")
logrus.Debugf("Using new RunMarker command")
prevFilesMap, _ := util.GetFSInfoMap("/", map[string]os.FileInfo{})
if err := runCommandInExec(config, buildArgs, r.cmd); err != nil {
return err
}
_, r.Files = util.GetFSInfoMap("/", prevFilesMap)

logrus.Debugf("files changed %s", r.Files)
logrus.Debugf("Files changed %s", r.Files)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/stopsignal.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type StopSignalCommand struct {

// ExecuteCommand handles command processing similar to CMD and RUN,
func (s *StopSignalCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: STOPSIGNAL")
logrus.Info("Cmd: STOPSIGNAL")

// resolve possible environment variables
replacementEnvs := buildArgs.ReplacementEnvs(config.Env)
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type UserCommand struct {
}

func (r *UserCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: USER")
logrus.Info("Cmd: USER")
u := r.cmd.User
userAndGroup := strings.Split(u, ":")
replacementEnvs := buildArgs.ReplacementEnvs(config.Env)
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type VolumeCommand struct {
}

func (v *VolumeCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: VOLUME")
logrus.Info("Cmd: VOLUME")
volumes := v.cmd.Volumes
replacementEnvs := buildArgs.ReplacementEnvs(config.Env)
resolvedVolumes, err := util.ResolveEnvironmentReplacementList(volumes, replacementEnvs, true)
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/workdir.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type WorkdirCommand struct {
var mkdir = os.MkdirAll

func (w *WorkdirCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error {
logrus.Info("cmd: workdir")
logrus.Info("Cmd: workdir")
workdirPath := w.cmd.Path
replacementEnvs := buildArgs.ReplacementEnvs(config.Env)
resolvedWorkingDir, err := util.ResolveEnvironmentReplacement(workdirPath, replacementEnvs, true)
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (b *multiArg) String() string {

// The second method is Set(value string) error
func (b *multiArg) Set(value string) error {
logrus.Debugf("appending to multi args %s", value)
logrus.Debugf("Appending to multi args %s", value)
*b = append(*b, value)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/dockerfile/dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func extractValFromQuotes(val string) (string, error) {
}

if leader != tail {
logrus.Infof("leader %s tail %s", leader, tail)
logrus.Infof("Leader %s tail %s", leader, tail)
return "", errors.New("quotes wrapping arg values must be matched")
}

Expand Down
20 changes: 10 additions & 10 deletions pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (s *stageBuilder) populateCopyCmdCompositeKey(command fmt.Stringer, from st
ds := digest
cacheKey, ok := s.digestToCacheKey[ds]
if ok {
logrus.Debugf("adding digest %v from previous stage to composite key for %v", ds, command.String())
logrus.Debugf("Adding digest %v from previous stage to composite key for %v", ds, command.String())
compositeKey.AddKey(cacheKey)
}
}
Expand Down Expand Up @@ -260,13 +260,13 @@ func (s *stageBuilder) optimize(compositeKey CompositeCache, cfg v1.Config) erro
return err
}

logrus.Debugf("optimize: composite key for command %v %v", command.String(), compositeKey)
logrus.Debugf("Optimize: composite key for command %v %v", command.String(), compositeKey)
ck, err := compositeKey.Hash()
if err != nil {
return errors.Wrap(err, "failed to hash composite key")
}

logrus.Debugf("optimize: cache key for command %v %v", command.String(), ck)
logrus.Debugf("Optimize: cache key for command %v %v", command.String(), ck)
s.finalCacheKey = ck

if command.ShouldCacheOutput() && !stopCache {
Expand Down Expand Up @@ -395,7 +395,7 @@ func (s *stageBuilder) build() error {
timing.DefaultRun.Stop(t)

if !s.shouldTakeSnapshot(index, command.MetadataOnly()) && !s.opts.ForceBuildMetadata {
logrus.Debugf("build: skipping snapshot for [%v]", command.String())
logrus.Debugf("Build: skipping snapshot for [%v]", command.String())
continue
}
if isCacheCommand {
Expand All @@ -411,13 +411,13 @@ func (s *stageBuilder) build() error {
}

if s.opts.Cache {
logrus.Debugf("build: composite key for command %v %v", command.String(), compositeKey)
logrus.Debugf("Build: composite key for command %v %v", command.String(), compositeKey)
ck, err := compositeKey.Hash()
if err != nil {
return errors.Wrap(err, "failed to hash composite key")
}

logrus.Debugf("build: cache key for command %v %v", command.String(), ck)
logrus.Debugf("Build: cache key for command %v %v", command.String(), ck)

// Push layer to cache (in parallel) now along with new config file
if command.ShouldCacheOutput() {
Expand All @@ -433,7 +433,7 @@ func (s *stageBuilder) build() error {
}

if err := cacheGroup.Wait(); err != nil {
logrus.Warnf("error uploading layer to cache: %s", err)
logrus.Warnf("Error uploading layer to cache: %s", err)
}

return nil
Expand Down Expand Up @@ -672,10 +672,10 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) {
}

stageIdxToDigest[fmt.Sprintf("%d", sb.stage.Index)] = d.String()
logrus.Debugf("mapping stage idx %v to digest %v", sb.stage.Index, d.String())
logrus.Debugf("Mapping stage idx %v to digest %v", sb.stage.Index, d.String())

digestToCacheKey[d.String()] = sb.finalCacheKey
logrus.Debugf("mapping digest %v to cachekey %v", d.String(), sb.finalCacheKey)
logrus.Debugf("Mapping digest %v to cachekey %v", d.String(), sb.finalCacheKey)

if stage.Final {
sourceImage, err = mutate.CreatedAt(sourceImage, v1.Time{Time: time.Now()})
Expand Down Expand Up @@ -827,7 +827,7 @@ func extractImageToDependencyDir(name string, image v1.Image) error {
if err := os.MkdirAll(dependencyDir, 0755); err != nil {
return err
}
logrus.Debugf("trying to extract to %s", dependencyDir)
logrus.Debugf("Trying to extract to %s", dependencyDir)
_, err := util.GetFSFromImage(dependencyDir, image, util.ExtractFile)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func writeDigestFile(path string, digestByteArray []byte) error {
parentDir := filepath.Dir(path)
if _, err := os.Stat(parentDir); os.IsNotExist(err) {
if err := os.MkdirAll(parentDir, 0700); err != nil {
logrus.Debugf("error creating %s, %s", parentDir, err)
logrus.Debugf("Error creating %s, %s", parentDir, err)
return err
}
logrus.Tracef("Created directory %v", parentDir)
Expand Down
12 changes: 6 additions & 6 deletions pkg/filesystem/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func ResolvePaths(paths []string, wl []util.IgnoreListEntry) (pathsToAdd []strin
for _, f := range paths {
// If the given path is part of the ignorelist ignore it
if util.IsInProvidedIgnoreList(f, wl) {
logrus.Debugf("path %s is in list to ignore, ignoring it", f)
logrus.Debugf("Path %s is in list to ignore, ignoring it", f)
continue
}

Expand All @@ -52,7 +52,7 @@ func ResolvePaths(paths []string, wl []util.IgnoreListEntry) (pathsToAdd []strin
}

if f != link {
logrus.Tracef("updated link %s to %s", f, link)
logrus.Tracef("Updated link %s to %s", f, link)
}

if !fileSet[link] {
Expand All @@ -67,21 +67,21 @@ func ResolvePaths(paths []string, wl []util.IgnoreListEntry) (pathsToAdd []strin
evaled, e = filepath.EvalSymlinks(f)
if e != nil {
if !os.IsNotExist(e) {
logrus.Errorf("couldn't eval %s with link %s", f, link)
logrus.Errorf("Couldn't eval %s with link %s", f, link)
return
}

logrus.Tracef("symlink path %s, target does not exist", f)
logrus.Tracef("Symlink path %s, target does not exist", f)
continue
}
if f != evaled {
logrus.Tracef("resolved symlink %s to %s", f, evaled)
logrus.Tracef("Resolved symlink %s to %s", f, evaled)
}

// If the given path is a symlink and the target is part of the ignorelist
// ignore the target
if util.CheckProvidedIgnoreList(evaled, wl) {
logrus.Debugf("path %s is ignored, ignoring it", evaled)
logrus.Debugf("Path %s is ignored, ignoring it", evaled)
continue
}

Expand Down
Loading

0 comments on commit 9676a69

Please sign in to comment.