summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/ps.go20
-rw-r--r--libpod/runtime.go5
-rw-r--r--pkg/spec/config_linux.go2
-rw-r--r--pkg/spec/parse.go14
4 files changed, 17 insertions, 24 deletions
diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go
index d63618e58..83274c9a8 100644
--- a/cmd/podman/ps.go
+++ b/cmd/podman/ps.go
@@ -329,16 +329,12 @@ func psCmd(c *cli.Context) error {
}
// Define a tab writer with stdout as the output
- w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
+ w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
defer w.Flush()
// Output standard PS headers
if !opts.Namespace {
- fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, himage, hcommand, hcreated, hstatus, hports, hnames)
- // If the user does not want size OR pod info, we print the isInfra bool
- if !opts.Size && !opts.Pod {
- fmt.Fprintf(w, "\t%s", hinfra)
- }
+ fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, himage, hcommand, hcreated, hstatus, hports, hnames)
// User wants pod info
if opts.Pod {
fmt.Fprintf(w, "\t%s", hpod)
@@ -349,22 +345,15 @@ func psCmd(c *cli.Context) error {
}
} else {
// Output Namespace headers
- fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, hnames, nspid, nscgroup, nsipc, nsmnt, nsnet, nspidns, nsuserns, nsuts)
- }
- if len(pss) == 0 {
- fmt.Fprint(w, "\n")
+ fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s", hid, hnames, nspid, nscgroup, nsipc, nsmnt, nsnet, nspidns, nsuserns, nsuts)
}
+
// Now iterate each container and output its information
for _, container := range pss {
// Standard PS output
if !opts.Namespace {
fmt.Fprintf(w, "\n%s\t%s\t%s\t%s\t%s\t%s\t%s", container.ID, container.Image, container.Command, container.Created, container.Status, container.Ports, container.Names)
-
- // If not size and not pod info, do isInfra
- if !opts.Size && !opts.Pod {
- fmt.Fprintf(w, "\t%t", container.IsInfra)
- }
// User wants pod info
if opts.Pod {
fmt.Fprintf(w, "\t%s", container.Pod)
@@ -387,6 +376,7 @@ func psCmd(c *cli.Context) error {
}
}
+ fmt.Fprint(w, "\n")
return nil
}
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 1b26f851f..318cd0369 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -184,6 +184,8 @@ var (
RuntimePath: []string{
"/usr/bin/runc",
"/usr/sbin/runc",
+ "/usr/local/bin/runc",
+ "/usr/local/sbin/runc",
"/sbin/runc",
"/bin/runc",
"/usr/lib/cri-o-runc/sbin/runc",
@@ -191,6 +193,7 @@ var (
ConmonPath: []string{
"/usr/libexec/podman/conmon",
"/usr/libexec/crio/conmon",
+ "/usr/local/lib/podman/conmon",
"/usr/local/libexec/crio/conmon",
"/usr/bin/conmon",
"/usr/sbin/conmon",
@@ -206,7 +209,7 @@ var (
MaxLogSize: -1,
NoPivotRoot: false,
CNIConfigDir: "/etc/cni/net.d/",
- CNIPluginDir: []string{"/usr/libexec/cni", "/usr/lib/cni", "/opt/cni/bin"},
+ CNIPluginDir: []string{"/usr/libexec/cni", "/usr/lib/cni", "/usr/local/lib/cni", "/opt/cni/bin"},
InfraCommand: DefaultInfraCommand,
InfraImage: DefaultInfraImage,
EnablePortReservation: true,
diff --git a/pkg/spec/config_linux.go b/pkg/spec/config_linux.go
index 20cdcc458..5bf8eff43 100644
--- a/pkg/spec/config_linux.go
+++ b/pkg/spec/config_linux.go
@@ -28,7 +28,7 @@ func Device(d *configs.Device) spec.LinuxDevice {
}
func addDevice(g *generate.Generator, device string) error {
- src, dst, permissions, err := parseDevice(device)
+ src, dst, permissions, err := ParseDevice(device)
if err != nil {
return err
}
diff --git a/pkg/spec/parse.go b/pkg/spec/parse.go
index 9b2dd1347..4d20e35d4 100644
--- a/pkg/spec/parse.go
+++ b/pkg/spec/parse.go
@@ -148,21 +148,21 @@ func getLoggingPath(opts []string) string {
return ""
}
-// parseDevice parses device mapping string to a src, dest & permissions string
-func parseDevice(device string) (string, string, string, error) { //nolint
+// ParseDevice parses device mapping string to a src, dest & permissions string
+func ParseDevice(device string) (string, string, string, error) { //nolint
src := ""
dst := ""
permissions := "rwm"
arr := strings.Split(device, ":")
switch len(arr) {
case 3:
- if !validDeviceMode(arr[2]) {
+ if !IsValidDeviceMode(arr[2]) {
return "", "", "", fmt.Errorf("invalid device mode: %s", arr[2])
}
permissions = arr[2]
fallthrough
case 2:
- if validDeviceMode(arr[1]) {
+ if IsValidDeviceMode(arr[1]) {
permissions = arr[1]
} else {
if arr[1][0] != '/' {
@@ -183,9 +183,9 @@ func parseDevice(device string) (string, string, string, error) { //nolint
return src, dst, permissions, nil
}
-// validDeviceMode checks if the mode for device is valid or not.
-// Valid mode is a composition of r (read), w (write), and m (mknod).
-func validDeviceMode(mode string) bool {
+// IsValidDeviceMode checks if the mode for device is valid or not.
+// IsValid mode is a composition of r (read), w (write), and m (mknod).
+func IsValidDeviceMode(mode string) bool {
var legalDeviceMode = map[rune]bool{
'r': true,
'w': true,