Merge pull request #103 from surajssd/fix-debug-statement

Use debugf to allow parsing of format specifier
This commit is contained in:
Daniel J Walsh
2017-12-11 14:03:21 -06:00
committed by GitHub
6 changed files with 10 additions and 13 deletions

View File

@ -71,7 +71,7 @@ func attachCmd(c *cli.Context) error {
wg.Add(1)
// Attach to the running container
go func() {
logrus.Debug("trying to attach to the container %s", ctr.ID())
logrus.Debugf("trying to attach to the container %s", ctr.ID())
defer wg.Done()
if err := ctr.Attach(c.Bool("no-stdin"), c.String("detach-keys"), attached); err != nil {
logrus.Errorf("unable to attach to container %s: %q", ctr.ID(), err)

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"path/filepath"
"reflect"
@ -11,15 +12,12 @@ import (
"github.com/docker/go-units"
specs "github.com/opencontainers/runtime-spec/specs-go"
"k8s.io/apimachinery/pkg/fields"
"fmt"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/cmd/kpod/formats"
"github.com/projectatomic/libpod/libpod"
"github.com/projectatomic/libpod/oci"
"github.com/urfave/cli"
"k8s.io/apimachinery/pkg/fields"
)
type psOptions struct {

View File

@ -100,7 +100,7 @@ func runCmd(c *cli.Context) error {
if err := ctr.Init(); err != nil {
return err
}
logrus.Debug("container storage created for %q", ctr.ID())
logrus.Debugf("container storage created for %q", ctr.ID())
if c.String("cidfile") != "" {
libpod.WriteFile(ctr.ID(), c.String("cidfile"))
@ -119,7 +119,7 @@ func runCmd(c *cli.Context) error {
wg.Add(1)
// Attach to the running container
go func() {
logrus.Debug("trying to attach to the container %s", ctr.ID())
logrus.Debugf("trying to attach to the container %s", ctr.ID())
defer wg.Done()
if err := ctr.Attach(false, c.String("detach-keys"), attached); err != nil {
logrus.Errorf("unable to attach to container %s: %q", ctr.ID(), err)

View File

@ -526,7 +526,7 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er
options = append(options, libpod.WithStdin())
}
if c.name != "" {
logrus.Debug("appending name %s", c.name)
logrus.Debugf("appending name %s", c.name)
options = append(options, libpod.WithName(c.name))
}

View File

@ -2,14 +2,14 @@ package main
import (
"fmt"
"os"
"strconv"
"sync"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"os"
"strconv"
)
var (
@ -104,7 +104,7 @@ func startCmd(c *cli.Context) error {
wg.Add(1)
// Attach to the running container
go func() {
logrus.Debug("trying to attach to the container %s", ctr.ID())
logrus.Debugf("trying to attach to the container %s", ctr.ID())
defer wg.Done()
if err := ctr.Attach(noStdIn, c.String("detach-keys"), attached); err != nil {
logrus.Errorf("unable to attach to container %s: %q", ctr.ID(), err)

View File

@ -2,17 +2,16 @@ package libpod
import (
"fmt"
"golang.org/x/crypto/ssh/terminal"
"io"
"net"
"os"
"path/filepath"
//"strconv"
"github.com/docker/docker/pkg/term"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/utils"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/sys/unix"
"k8s.io/client-go/tools/remotecommand"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"