Skip to content

Commit

Permalink
cmd/create, cmd/root, cmd/run: Tweak the debug logs for consistency
Browse files Browse the repository at this point in the history
Debug logs are sweeter when they are shorter.

containers#1258
  • Loading branch information
debarshiray committed Mar 7, 2023
1 parent fb15655 commit 2129e28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func createContainer(container, image, release, authFile string, showCommandToEn
runMediaMount = []string{"--volume", "/run/media:/run/media:rslave"}
}

logrus.Debug("Looking for toolbox.sh")
logrus.Debug("Looking up toolbox.sh")

var toolboxShMount []string

Expand Down Expand Up @@ -634,7 +634,7 @@ func getServiceSocket(serviceName string, unitName string) (string, error) {

func pullImage(image, release, authFile string) (bool, error) {
if ok := utils.ImageReferenceCanBeID(image); ok {
logrus.Debugf("Looking for image %s", image)
logrus.Debugf("Looking up image %s", image)

if _, err := podman.ImageExists(image); err == nil {
return true, nil
Expand All @@ -645,7 +645,7 @@ func pullImage(image, release, authFile string) (bool, error) {

if !hasDomain {
imageLocal := "localhost/" + image
logrus.Debugf("Looking for image %s", imageLocal)
logrus.Debugf("Looking up image %s", imageLocal)

if _, err := podman.ImageExists(imageLocal); err == nil {
return true, nil
Expand All @@ -664,7 +664,7 @@ func pullImage(image, release, authFile string) (bool, error) {
}
}

logrus.Debugf("Looking for image %s", imageFull)
logrus.Debugf("Looking up image %s", imageFull)

if _, err := podman.ImageExists(imageFull); err == nil {
return true, nil
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func setUpLoggers() error {
}

func validateSubIDRanges(cmd *cobra.Command, args []string, user *user.User) (bool, error) {
logrus.Debugf("Looking for sub-GID and sub-UID ranges for user %s", user.Username)
logrus.Debugf("Looking up sub-GID and sub-UID ranges for user %s", user.Username)

if user.Uid == "0" {
logrus.Debugf("Look-up not needed: user %s doesn't need them", user.Username)
Expand All @@ -407,7 +407,7 @@ func validateSubIDRanges(cmd *cobra.Command, args []string, user *user.User) (bo
}

if _, err := utils.ValidateSubIDRanges(user); err != nil {
logrus.Debugf("Looking for sub-GID and sub-UID ranges: %s", err)
logrus.Debugf("Looking up sub-GID and sub-UID ranges failed: %s", err)
return false, newSubIDError()
}

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func getEntryPointAndPID(container string) (string, int, error) {
}

func isCommandPresent(container, command string) (bool, error) {
logrus.Debugf("Looking for command %s in container %s", command, container)
logrus.Debugf("Looking up command %s in container %s", command, container)

logLevelString := podman.LogLevel.String()
args := []string{
Expand All @@ -575,7 +575,7 @@ func isCommandPresent(container, command string) (bool, error) {
}

func isPathPresent(container, path string) (bool, error) {
logrus.Debugf("Looking for path %s in container %s", path, container)
logrus.Debugf("Looking up path %s in container %s", path, container)

logLevelString := podman.LogLevel.String()
args := []string{
Expand Down

0 comments on commit 2129e28

Please sign in to comment.