summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml17
-rw-r--r--cmd/podman/containers/create.go3
-rw-r--r--cmd/podman/containers/logs.go24
-rw-r--r--cmd/podman/containers/rm.go3
-rw-r--r--cmd/podman/containers/run.go3
-rw-r--r--cmd/podman/containers/runlabel.go3
-rw-r--r--cmd/podman/images/build.go1
-rw-r--r--cmd/podman/images/list.go1
-rw-r--r--cmd/podman/images/load.go5
-rw-r--r--cmd/podman/images/pull.go2
-rw-r--r--cmd/podman/images/push.go2
-rw-r--r--cmd/podman/play/kube.go2
-rw-r--r--cmd/podman/system/service.go23
-rw-r--r--cmd/podman/system/varlink.go7
-rw-r--r--contrib/gate/Dockerfile3
-rw-r--r--docs/source/markdown/links/podman-image-diff.11
-rw-r--r--docs/source/markdown/podman-exec.1.md2
-rw-r--r--docs/source/markdown/podman-history.1.md5
-rw-r--r--docs/source/markdown/podman-image-diff.1.md46
-rw-r--r--docs/source/markdown/podman-image.1.md2
-rw-r--r--docs/source/markdown/podman-manifest-push.1.md18
-rw-r--r--docs/source/markdown/podman-network-inspect.1.md4
-rw-r--r--docs/source/markdown/podman-pull.1.md5
-rw-r--r--docs/source/markdown/podman-system-service.1.md6
-rw-r--r--docs/source/markdown/podman-varlink.1.md2
-rw-r--r--docs/source/markdown/podman-wait.1.md3
-rw-r--r--docs/source/markdown/podman.1.md6
-rwxr-xr-xhack/xref-helpmsgs-manpages4
-rw-r--r--pkg/api/handlers/compat/containers.go27
-rw-r--r--pkg/bindings/containers/containers.go7
-rw-r--r--pkg/bindings/containers/logs.go77
-rw-r--r--pkg/bindings/test/containers_test.go4
-rw-r--r--pkg/domain/infra/abi/system.go38
-rw-r--r--pkg/domain/infra/abi/system_novalink.go14
-rw-r--r--pkg/domain/infra/abi/system_varlink.go49
-rw-r--r--pkg/domain/infra/tunnel/containers.go35
-rw-r--r--pkg/specgen/generate/config_linux_nocgo.go3
-rwxr-xr-xtest/apiv2/test-apiv22
-rw-r--r--test/e2e/libpod_suite_remote_test.go9
-rw-r--r--test/e2e/libpod_suite_varlink_test.go2
-rw-r--r--test/e2e/logs_test.go117
-rw-r--r--test/endpoint/endpoint.go2
42 files changed, 349 insertions, 240 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index ba8d16803..2de08cf9e 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -137,11 +137,9 @@ gating_task:
# FIXME
#- 'cd $GOSRC && ./hack/podman-commands.sh |& ${TIMESTAMP}'
# N/B: need 'clean' so some committed files are re-generated.
- # FIXME
- #- '/usr/local/bin/entrypoint.sh clean podman-remote |& ${TIMESTAMP}'
- #- '/usr/local/bin/entrypoint.sh clean podman xref_helpmsgs_manpages BUILDTAGS="exclude_graphdriver_devicemapper selinux seccomp" |& ${TIMESTAMP}'
- # FIXME
- #- '/usr/local/bin/entrypoint.sh local-cross |& ${TIMESTAMP}'
+ - '/usr/local/bin/entrypoint.sh clean podman-remote |& ${TIMESTAMP}'
+ - '/usr/local/bin/entrypoint.sh clean podman xref_helpmsgs_manpages BUILDTAGS="exclude_graphdriver_devicemapper selinux seccomp" |& ${TIMESTAMP}'
+ - '/usr/local/bin/entrypoint.sh local-cross |& ${TIMESTAMP}'
# Verify some aspects of ci/related scripts
ci_script:
@@ -311,8 +309,6 @@ build_each_commit_task:
build_without_cgo_task:
- skip: $CI == 'true'
-
depends_on:
- "gating"
- "vendor"
@@ -492,10 +488,9 @@ special_testing_rootless_task:
ADD_SECOND_PARTITION: 'true'
SPECIALMODE: 'rootless' # See docs
matrix:
- # FIX ME ...
- #- name: remote
- # env:
- # TEST_REMOTE_CLIENT: 'true'
+ - name: remote
+ env:
+ TEST_REMOTE_CLIENT: 'true'
- name: local
env:
TEST_REMOTE_CLIENT: 'false'
diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go
index bb6cb5fdd..c8007bc2f 100644
--- a/cmd/podman/containers/create.go
+++ b/cmd/podman/containers/create.go
@@ -62,6 +62,9 @@ func createFlags(flags *pflag.FlagSet) {
_ = flags.MarkHidden("env-host")
_ = flags.MarkHidden("http-proxy")
}
+ // Not sure we want these exposed yet. If we do, they need to be documented in man pages
+ _ = flags.MarkHidden("override-arch")
+ _ = flags.MarkHidden("override-os")
}
func init() {
diff --git a/cmd/podman/containers/logs.go b/cmd/podman/containers/logs.go
index 2b8c3ed5f..de5234044 100644
--- a/cmd/podman/containers/logs.go
+++ b/cmd/podman/containers/logs.go
@@ -29,7 +29,18 @@ var (
Use: "logs [flags] CONTAINER [CONTAINER...]",
Short: "Fetch the logs of one or more containers",
Long: logsDescription,
- RunE: logs,
+ Args: func(cmd *cobra.Command, args []string) error {
+ switch {
+ case registry.IsRemote() && len(args) > 1:
+ return errors.New(cmd.Name() + " does not support multiple containers when run remotely")
+ case logsOptions.Latest && len(args) > 0:
+ return errors.New("no containers can be specified when using 'latest'")
+ case !logsOptions.Latest && len(args) < 1:
+ return errors.New("specify at least one container name or ID to log")
+ }
+ return nil
+ },
+ RunE: logs,
Example: `podman logs ctrID
podman logs --names ctrID1 ctrID2
podman logs --tail 2 mywebserver
@@ -41,6 +52,7 @@ var (
Use: logsCommand.Use,
Short: logsCommand.Short,
Long: logsCommand.Long,
+ Args: logsCommand.Args,
RunE: logsCommand.RunE,
Example: `podman container logs ctrID
podman container logs --names ctrID1 ctrID2
@@ -53,7 +65,7 @@ var (
func init() {
// logs
registry.Commands = append(registry.Commands, registry.CliCommand{
- Mode: []entities.EngineMode{entities.ABIMode},
+ Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: logsCommand,
})
@@ -62,7 +74,7 @@ func init() {
// container logs
registry.Commands = append(registry.Commands, registry.CliCommand{
- Mode: []entities.EngineMode{entities.ABIMode},
+ Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: containerLogsCommand,
Parent: containerCmd,
})
@@ -84,12 +96,6 @@ func logsFlags(flags *pflag.FlagSet) {
}
func logs(cmd *cobra.Command, args []string) error {
- if len(args) > 0 && logsOptions.Latest {
- return errors.New("no containers can be specified when using 'latest'")
- }
- if !logsOptions.Latest && len(args) < 1 {
- return errors.New("specify at least one container name or ID to log")
- }
if logsOptions.SinceRaw != "" {
// parse time, error out if something is wrong
since, err := util.ParseInputTime(logsOptions.SinceRaw)
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index f01462447..b25473a8d 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -74,8 +74,7 @@ func init() {
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
Command: rmCommand,
})
- flags := rmCommand.Flags()
- rmFlags(flags)
+ rmFlags(rmCommand.Flags())
registry.Commands = append(registry.Commands, registry.CliCommand{
Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go
index 2298691a9..890c6e827 100644
--- a/cmd/podman/containers/run.go
+++ b/cmd/podman/containers/run.go
@@ -63,6 +63,9 @@ func runFlags(flags *pflag.FlagSet) {
_ = flags.MarkHidden("env-host")
_ = flags.MarkHidden("http-proxy")
}
+ // Not sure we want these exposed yet. If we do, they need to be documented in man pages
+ _ = flags.MarkHidden("override-arch")
+ _ = flags.MarkHidden("override-os")
}
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
diff --git a/cmd/podman/containers/runlabel.go b/cmd/podman/containers/runlabel.go
index 11fa362b8..8d1c48ad2 100644
--- a/cmd/podman/containers/runlabel.go
+++ b/cmd/podman/containers/runlabel.go
@@ -42,7 +42,7 @@ func init() {
Parent: containerCmd,
})
- flags := rmCommand.Flags()
+ flags := runlabelCommand.Flags()
flags.StringVar(&runlabelOptions.Authfile, "authfile", auth.GetDefaultAuthFile(), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override")
flags.StringVar(&runlabelOptions.CertDir, "cert-dir", "", "`Pathname` of a directory containing TLS certificates and keys")
flags.StringVar(&runlabelOptions.Credentials, "creds", "", "`Credentials` (USERNAME:PASSWORD) to use for authenticating to a registry")
@@ -61,6 +61,7 @@ func init() {
_ = flags.MarkHidden("opt1")
_ = flags.MarkHidden("opt2")
_ = flags.MarkHidden("opt3")
+ _ = flags.MarkHidden("signature-policy")
if err := flags.MarkDeprecated("pull", "podman will pull if not found in local storage"); err != nil {
logrus.Error("unable to mark pull flag deprecated")
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 06a7efd25..2efc795cd 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -126,6 +126,7 @@ func buildFlags(flags *pflag.FlagSet) {
os.Exit(1)
}
flags.AddFlagSet(&fromAndBudFlags)
+ _ = flags.MarkHidden("signature-policy")
}
// build executes the build command.
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index 022c90f71..4f8948b8b 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -74,7 +74,6 @@ func imageListFlagSet(flags *pflag.FlagSet) {
flags.BoolVar(&listFlag.digests, "digests", false, "Show digests")
flags.BoolVarP(&listFlag.noHeading, "noheading", "n", false, "Do not print column headings")
flags.BoolVar(&listFlag.noTrunc, "no-trunc", false, "Do not truncate output")
- flags.BoolVar(&listFlag.noTrunc, "notruncate", false, "Do not truncate output")
flags.BoolVarP(&listFlag.quiet, "quiet", "q", false, "Display only image IDs")
flags.StringVar(&listFlag.sort, "sort", "created", "Sort by "+sortFields.String())
flags.BoolVarP(&listFlag.history, "history", "", false, "Display the image name history")
diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go
index 4bbffd432..a984ad81f 100644
--- a/cmd/podman/images/load.go
+++ b/cmd/podman/images/load.go
@@ -60,10 +60,7 @@ func loadFlags(flags *pflag.FlagSet) {
flags.StringVarP(&loadOpts.Input, "input", "i", "", "Read from specified archive file (default: stdin)")
flags.BoolVarP(&loadOpts.Quiet, "quiet", "q", false, "Suppress the output")
flags.StringVar(&loadOpts.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file")
- if registry.IsRemote() {
- _ = flags.MarkHidden("signature-policy")
- }
-
+ _ = flags.MarkHidden("signature-policy")
}
func load(cmd *cobra.Command, args []string) error {
diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go
index 9e883703f..7bb4f6d37 100644
--- a/cmd/podman/images/pull.go
+++ b/cmd/podman/images/pull.go
@@ -87,9 +87,9 @@ func pullFlags(flags *pflag.FlagSet) {
if registry.IsRemote() {
_ = flags.MarkHidden("authfile")
_ = flags.MarkHidden("cert-dir")
- _ = flags.MarkHidden("signature-policy")
_ = flags.MarkHidden("tls-verify")
}
+ _ = flags.MarkHidden("signature-policy")
}
// imagePull is implement the command for pulling images.
diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go
index dd536213f..35a6254de 100644
--- a/cmd/podman/images/push.go
+++ b/cmd/podman/images/push.go
@@ -87,9 +87,9 @@ func pushFlags(flags *pflag.FlagSet) {
_ = flags.MarkHidden("cert-dir")
_ = flags.MarkHidden("compress")
_ = flags.MarkHidden("quiet")
- _ = flags.MarkHidden("signature-policy")
_ = flags.MarkHidden("tls-verify")
}
+ _ = flags.MarkHidden("signature-policy")
}
// imagePush is implement the command for pushing images.
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index 2499b54b9..5703cd314 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -59,6 +59,8 @@ func init() {
flags.StringVar(&kubeOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)")
flags.StringVar(&kubeOptions.SeccompProfileRoot, "seccomp-profile-root", defaultSeccompRoot, "Directory path for seccomp profiles")
}
+
+ _ = flags.MarkHidden("signature-policy")
}
func kube(cmd *cobra.Command, args []string) error {
diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go
index b5dd2f2aa..0f42ae28b 100644
--- a/cmd/podman/system/service.go
+++ b/cmd/podman/system/service.go
@@ -17,6 +17,7 @@ import (
"github.com/containers/libpod/pkg/util"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ "github.com/spf13/pflag"
)
var (
@@ -26,13 +27,12 @@ Enable a listening service for API access to Podman commands.
`
srvCmd = &cobra.Command{
- Use: "service [flags] [URI]",
- Args: cobra.MaximumNArgs(1),
- Short: "Run API service",
- Long: srvDescription,
- RunE: service,
- Example: `podman system service --time=0 unix:///tmp/podman.sock
- podman system service --varlink --time=0 unix:///tmp/podman.sock`,
+ Use: "service [flags] [URI]",
+ Args: cobra.MaximumNArgs(1),
+ Short: "Run API service",
+ Long: srvDescription,
+ RunE: service,
+ Example: `podman system service --time=0 unix:///tmp/podman.sock`,
}
srvArgs = struct {
@@ -50,10 +50,17 @@ func init() {
flags := srvCmd.Flags()
flags.Int64VarP(&srvArgs.Timeout, "time", "t", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout")
- flags.Int64Var(&srvArgs.Timeout, "timeout", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout")
flags.BoolVar(&srvArgs.Varlink, "varlink", false, "Use legacy varlink service instead of REST")
_ = flags.MarkDeprecated("varlink", "valink API is deprecated.")
+ flags.SetNormalizeFunc(aliasTimeoutFlag)
+}
+
+func aliasTimeoutFlag(_ *pflag.FlagSet, name string) pflag.NormalizedName {
+ if name == "timeout" {
+ name = "time"
+ }
+ return pflag.NormalizedName(name)
}
func service(cmd *cobra.Command, args []string) error {
diff --git a/cmd/podman/system/varlink.go b/cmd/podman/system/varlink.go
index c83f5ff76..6a38b3d28 100644
--- a/cmd/podman/system/varlink.go
+++ b/cmd/podman/system/varlink.go
@@ -1,3 +1,5 @@
+// +build linux
+
package system
import (
@@ -20,7 +22,7 @@ var (
Long: varlinkDescription,
RunE: varlinkE,
Example: `podman varlink unix:/run/podman/io.podman
- podman varlink --timeout 5000 unix:/run/podman/io.podman`,
+ podman varlink --time 5000 unix:/run/podman/io.podman`,
}
varlinkArgs = struct {
Timeout int64
@@ -34,8 +36,7 @@ func init() {
})
flags := varlinkCmd.Flags()
flags.Int64VarP(&varlinkArgs.Timeout, "time", "t", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout")
- flags.Int64Var(&varlinkArgs.Timeout, "timeout", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout")
-
+ flags.SetNormalizeFunc(aliasTimeoutFlag)
}
func varlinkE(cmd *cobra.Command, args []string) error {
diff --git a/contrib/gate/Dockerfile b/contrib/gate/Dockerfile
index f7cd8f2b3..9042ddeb4 100644
--- a/contrib/gate/Dockerfile
+++ b/contrib/gate/Dockerfile
@@ -10,8 +10,9 @@ ENV GOPATH="/var/tmp/go" \
COPY / $GOSRC
# Install packages from dependencies.txt, ignoring commented lines
+# Note: adding conmon so podman command checks will work
RUN dnf -y install \
- $(grep "^[^#]" $GOSRC/contrib/dependencies.txt) \
+ $(grep "^[^#]" $GOSRC/contrib/dependencies.txt) conmon \
&& dnf clean all
# Install dependencies
diff --git a/docs/source/markdown/links/podman-image-diff.1 b/docs/source/markdown/links/podman-image-diff.1
deleted file mode 100644
index ac4881f98..000000000
--- a/docs/source/markdown/links/podman-image-diff.1
+++ /dev/null
@@ -1 +0,0 @@
-.so man1/podman-diff.1
diff --git a/docs/source/markdown/podman-exec.1.md b/docs/source/markdown/podman-exec.1.md
index b24a1f8aa..f44a3d3d9 100644
--- a/docs/source/markdown/podman-exec.1.md
+++ b/docs/source/markdown/podman-exec.1.md
@@ -13,7 +13,7 @@ podman\-exec - Execute a command in a running container
## OPTIONS
-**--detach**
+**--detach**, **-d**
Start the exec session, but do not attach to it. The command will run in the background and the exec session will be automatically removed when it completes. The **podman exec** command will print the ID of the exec session and exit immediately after it starts.
diff --git a/docs/source/markdown/podman-history.1.md b/docs/source/markdown/podman-history.1.md
index 1a8f8906c..26b213af9 100644
--- a/docs/source/markdown/podman-history.1.md
+++ b/docs/source/markdown/podman-history.1.md
@@ -37,10 +37,13 @@ Display sizes and dates in human readable format (default *true*).
Do not truncate the output (default *false*).
+**--notruncate**
+
+Do not truncate the output
+
**--quiet**, **-q**=*true|false*
Print the numeric IDs only (default *false*).
-
**--format**=*format*
Alter the output for a format like 'json' or a Go template.
diff --git a/docs/source/markdown/podman-image-diff.1.md b/docs/source/markdown/podman-image-diff.1.md
new file mode 100644
index 000000000..1e7397cd8
--- /dev/null
+++ b/docs/source/markdown/podman-image-diff.1.md
@@ -0,0 +1,46 @@
+% podman-image-diff(1)
+
+## NAME
+podman-image-diff - Inspect changes on an image's filesystem
+
+## SYNOPSIS
+**podman image diff** [*options*] *name*
+
+## DESCRIPTION
+Displays changes on a container or image's filesystem. The container or image will be compared to its parent layer
+
+## OPTIONS
+
+**--format**
+
+Alter the output into a different format. The only valid format for diff is `json`.
+
+## EXAMPLE
+
+```
+# podman diff redis:old redis:alpine
+C /usr
+C /usr/local
+C /usr/local/bin
+A /usr/local/bin/docker-entrypoint.sh
+```
+
+```
+# podman diff --format json redis:old redis:alpine
+{
+ "changed": [
+ "/usr",
+ "/usr/local",
+ "/usr/local/bin"
+ ],
+ "added": [
+ "/usr/local/bin/docker-entrypoint.sh"
+ ]
+}
+```
+
+## SEE ALSO
+podman(1)
+
+## HISTORY
+August 2017, Originally compiled by Ryan Cole <rycole@redhat.com>
diff --git a/docs/source/markdown/podman-image.1.md b/docs/source/markdown/podman-image.1.md
index 1552098ac..dfff57b31 100644
--- a/docs/source/markdown/podman-image.1.md
+++ b/docs/source/markdown/podman-image.1.md
@@ -14,6 +14,7 @@ The image command allows you to manage images
| Command | Man Page | Description |
| -------- | ----------------------------------------------- | --------------------------------------------------------------------------- |
| build | [podman-build(1)](podman-build.1.md) | Build a container using a Dockerfile. |
+| diff | [podman-image-diff(1)](podman-image-diff.1.md) | Inspect changes on an image's filesystem. |
| exists | [podman-image-exists(1)](podman-image-exists.1.md) | Check if an image exists in local storage. |
| history | [podman-history(1)](podman-history.1.md) | Show the history of an image. |
| import | [podman-import(1)](podman-import.1.md) | Import a tarball and save it as a filesystem image. |
@@ -25,6 +26,7 @@ The image command allows you to manage images
| push | [podman-push(1)](podman-push.1.md) | Push an image from local storage to elsewhere. |
| rm | [podman-rmi(1)](podman-rmi.1.md) | Removes one or more locally stored images. |
| save | [podman-save(1)](podman-save.1.md) | Save an image to docker-archive or oci. |
+| search | [podman-search(1)](podman-search.1.md) | Search a registry for an image. |
| sign | [podman-image-sign(1)](podman-image-sign.1.md) | Create a signature for an image. |
| tag | [podman-tag(1)](podman-tag.1.md) | Add an additional name to a local image. |
| untag | [podman-untag(1)](podman-untag.1.md) | Removes one or more names from a locally-stored image. |
diff --git a/docs/source/markdown/podman-manifest-push.1.md b/docs/source/markdown/podman-manifest-push.1.md
index 38d0c5904..ab3287a7c 100644
--- a/docs/source/markdown/podman-manifest-push.1.md
+++ b/docs/source/markdown/podman-manifest-push.1.md
@@ -19,7 +19,7 @@ The list image's ID and the digest of the image's manifest.
Push the images mentioned in the manifest list or image index, in addition to
the list or index itself.
-**--authfile** *path*
+**--authfile**=*path*
Path of the authentication file. Default is ${XDG\_RUNTIME\_DIR}/containers/auth.json, which is set using `podman login`.
If the authorization state is not found there, $HOME/.docker/config.json is checked, which is set using `docker login`. (Not available for remote commands)
@@ -27,22 +27,22 @@ If the authorization state is not found there, $HOME/.docker/config.json is chec
Note: You can also override the default path of the authentication file by setting the REGISTRY\_AUTH\_FILE
environment variable. `export REGISTRY_AUTH_FILE=path`
-**--cert-dir** *path*
+**--cert-dir**=*path*
Use certificates at *path* (\*.crt, \*.cert, \*.key) to connect to the registry.
Default certificates directory is _/etc/containers/certs.d_. (Not available for remote commands)
-**--creds** *creds*
+**--creds**=*creds*
The [username[:password]] to use to authenticate with the registry if required.
If one or both values are not supplied, a command line prompt will appear and the
value can be entered. The password is entered without echo.
-**--digestfile** *Digestfile*
+**--digestfile**=*Digestfile*
After copying the image, write the digest of the resulting image to the file.
-**--format, -f**
+**--format**, **-f**=*format*
Manifest list type (oci or v2s2) to use when pushing the list (default is oci).
@@ -50,15 +50,19 @@ Manifest list type (oci or v2s2) to use when pushing the list (default is oci).
Delete the manifest list or image index from local storage if pushing succeeds.
+**--quiet**, **-q**
+
+When writing the manifest, suppress progress output
+
**--remove-signatures**
Don't copy signatures when pushing images.
-**--sign-by** *fingerprint*
+**--sign-by**=*fingerprint*
Sign the pushed images using the GPG key that matches the specified fingerprint.
-**--tls-verify** *bool-value*
+**--tls-verify**
Require HTTPS and verify certificates when talking to container registries (defaults to true) (Not available for remote commands)
diff --git a/docs/source/markdown/podman-network-inspect.1.md b/docs/source/markdown/podman-network-inspect.1.md
index ca6875d18..86fa2552e 100644
--- a/docs/source/markdown/podman-network-inspect.1.md
+++ b/docs/source/markdown/podman-network-inspect.1.md
@@ -10,10 +10,6 @@ podman\-network\-inspect - Displays the raw CNI network configuration for one or
Display the raw (JSON format) network configuration. This command is not available for rootless users.
## OPTIONS
-**--quiet**, **-q**
-
-The `quiet` option will restrict the output to only the network names.
-
**--format**, **-f**
Pretty-print networks to JSON or using a Go template.
diff --git a/docs/source/markdown/podman-pull.1.md b/docs/source/markdown/podman-pull.1.md
index aa558526a..5d941219a 100644
--- a/docs/source/markdown/podman-pull.1.md
+++ b/docs/source/markdown/podman-pull.1.md
@@ -73,7 +73,10 @@ The [username[:password]] to use to authenticate with the registry if required.
If one or both values are not supplied, a command line prompt will appear and the
value can be entered. The password is entered without echo.
-**--override-arch**=ARCH
+**--override-os**=*OS*
+Use OS instead of the running OS for choosing images
+
+**--override-arch**=*ARCH*
Override the machine's default architecture of the image to be pulled. For example, `arm`.
diff --git a/docs/source/markdown/podman-system-service.1.md b/docs/source/markdown/podman-system-service.1.md
index a2fefe4dd..48e595641 100644
--- a/docs/source/markdown/podman-system-service.1.md
+++ b/docs/source/markdown/podman-system-service.1.md
@@ -15,15 +15,11 @@ example *unix:/run/user/1000/podman/podman.sock*)
## OPTIONS
-**--timeout**, **-t**
+**--time**, **-t**
The time until the session expires in _milliseconds_. The default is 1
second. A value of `0` means no timeout and the session will not expire.
-**--varlink**
-
-Use the varlink protocol instead of the REST-based protocol. This option will be deprecated in the future.
-
**--help**, **-h**
Print usage statement.
diff --git a/docs/source/markdown/podman-varlink.1.md b/docs/source/markdown/podman-varlink.1.md
index 0d2ab1668..0b04d5ba3 100644
--- a/docs/source/markdown/podman-varlink.1.md
+++ b/docs/source/markdown/podman-varlink.1.md
@@ -19,7 +19,7 @@ The varlink service should generally be done with systemd. See _Configuration_
Print usage statement
-**--timeout**, **-t**
+**--time**, **-t**
The time until the varlink session expires in _milliseconds_. The default is 1
second. A value of `0` means no timeout and the session will not expire.
diff --git a/docs/source/markdown/podman-wait.1.md b/docs/source/markdown/podman-wait.1.md
index ce1c70a5f..886bbc55b 100644
--- a/docs/source/markdown/podman-wait.1.md
+++ b/docs/source/markdown/podman-wait.1.md
@@ -15,6 +15,9 @@ After the container stops, the container's return code is printed.
## OPTIONS
+**--condition**=*state*
+Condition to wait on (default "stopped")
+
**--help**, **-h**
Print usage statement
diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md
index 6bac0cc9d..02f23e6cc 100644
--- a/docs/source/markdown/podman.1.md
+++ b/docs/source/markdown/podman.1.md
@@ -58,6 +58,9 @@ Podman and libpod currently support an additional `precreate` state which is cal
**WARNING**: the `precreate` hook lets you do powerful things, such as adding additional mounts to the runtime configuration. That power also makes it easy to break things. Before reporting libpod errors, try running your container with `precreate` hooks disabled to see if the problem is due to one of your hooks.
+**--identity**=*path*
+Path to SSH identity file
+
**--log-level**=*level*
Log messages above specified level: debug, info, warn, error (default), fatal or panic (default: "error")
@@ -70,6 +73,9 @@ When namespace is set, created containers and pods will join the given namespace
**--network-cmd-path**=*path*
Path to the command binary to use for setting up a network. It is currently only used for setting up a slirp4netns network. If "" is used then the binary is looked up using the $PATH environment variable.
+**--remote**, **-r**=*url*
+URL to access Podman service (default "unix:/run/user/3267/podman/podman.sock")
+
**--root**=*value*
Storage root dir in which data, including images, is stored (default: "/var/lib/containers/storage" for UID 0, "$HOME/.local/share/containers/storage" for other users).
diff --git a/hack/xref-helpmsgs-manpages b/hack/xref-helpmsgs-manpages
index 00db3c8de..c1e9dffc4 100755
--- a/hack/xref-helpmsgs-manpages
+++ b/hack/xref-helpmsgs-manpages
@@ -150,6 +150,10 @@ sub xref_by_man {
my %ignore = map { $_ => 1 } qw(-l -s -t --latest --size --type);
next if $man =~ /-inspect/ && $ignore{$k};
+ # Special case: podman-diff serves dual purpose (image, ctr)
+ my %diffignore = map { $_ => 1 } qw(-l --latest );
+ next if $man =~ /-diff/ && $diffignore{$k};
+
# Special case: the 'trust' man page is a mess
next if $man =~ /-trust/;
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 239e41af4..cea4bd0f6 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -4,6 +4,7 @@ import (
"encoding/binary"
"encoding/json"
"fmt"
+ "io"
"net/http"
"strconv"
"strings"
@@ -295,7 +296,9 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
}()
w.WriteHeader(http.StatusOK)
- var builder strings.Builder
+
+ var frame strings.Builder
+ header := make([]byte, 8)
for ok := true; ok; ok = query.Follow {
for line := range logChannel {
if _, found := r.URL.Query()["until"]; found {
@@ -304,10 +307,8 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
}
}
- // Reset variables we're ready to loop again
- builder.Reset()
- header := [8]byte{}
-
+ // Reset buffer we're ready to loop again
+ frame.Reset()
switch line.Device {
case "stdout":
if !query.Stdout {
@@ -327,17 +328,17 @@ func LogsFromContainer(w http.ResponseWriter, r *http.Request) {
}
if query.Timestamps {
- builder.WriteString(line.Time.Format(time.RFC3339))
- builder.WriteRune(' ')
+ frame.WriteString(line.Time.Format(time.RFC3339))
+ frame.WriteString(" ")
}
- builder.WriteString(line.Msg)
- // Build header and output entry
- binary.BigEndian.PutUint32(header[4:], uint32(len(header)+builder.Len()))
- if _, err := w.Write(header[:]); err != nil {
+ frame.WriteString(line.Msg)
+
+ binary.BigEndian.PutUint32(header[4:], uint32(frame.Len()))
+ if _, err := w.Write(header[0:8]); err != nil {
log.Errorf("unable to write log output header: %q", err)
}
- if _, err := fmt.Fprint(w, builder.String()); err != nil {
- log.Errorf("unable to write builder string: %q", err)
+ if _, err := io.WriteString(w, frame.String()); err != nil {
+ log.Errorf("unable to write frame string: %q", err)
}
if flusher, ok := w.(http.Flusher); ok {
flusher.Flush()
diff --git a/pkg/bindings/containers/containers.go b/pkg/bindings/containers/containers.go
index 1ed4919e0..39a077f36 100644
--- a/pkg/bindings/containers/containers.go
+++ b/pkg/bindings/containers/containers.go
@@ -23,7 +23,7 @@ import (
)
var (
- ErrLostSync = errors.New("lost synchronization with attach multiplexed result")
+ ErrLostSync = errors.New("lost synchronization with multiplexed stream")
)
// List obtains a list of containers in local storage. All parameters to this method are optional.
@@ -485,7 +485,7 @@ func Attach(ctx context.Context, nameOrId string, detachKeys *string, logs, stre
return err
}
case fd == 3:
- return fmt.Errorf("error from daemon in stream: %s", frame)
+ return errors.New("error from service in stream: " + string(frame))
default:
return fmt.Errorf("unrecognized input header: %d", fd)
}
@@ -507,7 +507,7 @@ func DemuxHeader(r io.Reader, buffer []byte) (fd, sz int, err error) {
fd = int(buffer[0])
if fd < 0 || fd > 3 {
- err = ErrLostSync
+ err = errors.Wrapf(ErrLostSync, fmt.Sprintf(`channel "%d" found, 0-3 supported`, fd))
return
}
@@ -528,7 +528,6 @@ func DemuxFrame(r io.Reader, buffer []byte, length int) (frame []byte, err error
err = io.ErrUnexpectedEOF
return
}
-
return buffer[0:length], nil
}
diff --git a/pkg/bindings/containers/logs.go b/pkg/bindings/containers/logs.go
index b7ecb3c7e..20c8b4292 100644
--- a/pkg/bindings/containers/logs.go
+++ b/pkg/bindings/containers/logs.go
@@ -1,8 +1,9 @@
package containers
import (
+ "bytes"
"context"
- "encoding/binary"
+ "fmt"
"io"
"net/http"
"net/url"
@@ -49,68 +50,34 @@ func Logs(ctx context.Context, nameOrID string, opts LogOptions, stdoutChan, std
if err != nil {
return err
}
+ defer response.Body.Close()
- // read 8 bytes
- // first byte determines stderr=2|stdout=1
- // bytes 4-7 len(msg) in uint32
+ buffer := make([]byte, 1024)
for {
- stream, msgSize, err := readHeader(response.Body)
+ fd, l, err := DemuxHeader(response.Body, buffer)
if err != nil {
- // In case the server side closes up shop because !follow
- if err == io.EOF {
- break
+ if errors.Is(err, io.EOF) {
+ return nil
}
- return errors.Wrap(err, "unable to read log header")
+ return err
}
- msg, err := readMsg(response.Body, msgSize)
+ frame, err := DemuxFrame(response.Body, buffer, l)
if err != nil {
- return errors.Wrap(err, "unable to read log message")
+ return err
}
- if stream == 1 {
- stdoutChan <- msg
- } else {
- stderrChan <- msg
- }
- }
- return nil
-}
+ frame = bytes.Replace(frame[0:l], []byte{13}, []byte{10}, -1)
-func readMsg(r io.Reader, msgSize int) (string, error) {
- var msg []byte
- size := msgSize
- for {
- b := make([]byte, size)
- _, err := r.Read(b)
- if err != nil {
- return "", err
- }
- msg = append(msg, b...)
- if len(msg) == msgSize {
- break
- }
- size = msgSize - len(msg)
- }
- return string(msg), nil
-}
-
-func readHeader(r io.Reader) (byte, int, error) {
- var (
- header []byte
- size = 8
- )
- for {
- b := make([]byte, size)
- _, err := r.Read(b)
- if err != nil {
- return 0, 0, err
- }
- header = append(header, b...)
- if len(header) == 8 {
- break
+ switch fd {
+ case 0:
+ stdoutChan <- string(frame)
+ case 1:
+ stdoutChan <- string(frame)
+ case 2:
+ stderrChan <- string(frame)
+ case 3:
+ return errors.New("error from service in stream: " + string(frame))
+ default:
+ return fmt.Errorf("unrecognized input header: %d", fd)
}
- size = 8 - len(header)
}
- stream := header[0]
- msgSize := int(binary.BigEndian.Uint32(header[4:]) - 8)
- return stream, msgSize, nil
}
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go
index f725d1cf2..3b94b10eb 100644
--- a/pkg/bindings/test/containers_test.go
+++ b/pkg/bindings/test/containers_test.go
@@ -378,9 +378,9 @@ var _ = Describe("Podman containers ", func() {
containers.Logs(bt.conn, r.ID, opts, stdoutChan, nil)
}()
o := <-stdoutChan
- o = strings.ReplaceAll(o, "\r", "")
+ o = strings.TrimSpace(o)
_, err = time.Parse(time.RFC1123Z, o)
- Expect(err).To(BeNil())
+ Expect(err).ShouldNot(HaveOccurred())
})
It("podman top", func() {
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index af2ec5f7b..52dfaba7d 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -16,56 +16,18 @@ import (
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
- iopodman "github.com/containers/libpod/pkg/varlink"
- iopodmanAPI "github.com/containers/libpod/pkg/varlinkapi"
"github.com/containers/libpod/utils"
- "github.com/containers/libpod/version"
"github.com/docker/distribution/reference"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
- "github.com/varlink/go/varlink"
)
func (ic *ContainerEngine) Info(ctx context.Context) (*define.Info, error) {
return ic.Libpod.Info()
}
-func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.ServiceOptions) error {
- var varlinkInterfaces = []*iopodman.VarlinkInterface{
- iopodmanAPI.New(opts.Command, ic.Libpod),
- }
-
- service, err := varlink.NewService(
- "Atomic",
- "podman",
- version.Version,
- "https://github.com/containers/libpod",
- )
- if err != nil {
- return errors.Wrapf(err, "unable to create new varlink service")
- }
-
- for _, i := range varlinkInterfaces {
- if err := service.RegisterInterface(i); err != nil {
- return errors.Errorf("unable to register varlink interface %v", i)
- }
- }
-
- // Run the varlink server at the given address
- if err = service.Listen(opts.URI, opts.Timeout); err != nil {
- switch err.(type) {
- case varlink.ServiceTimeoutError:
- logrus.Infof("varlink service expired (use --timeout to increase session time beyond %s ms, 0 means never timeout)", opts.Timeout.String())
- return nil
- default:
- return errors.Wrapf(err, "unable to start varlink service")
- }
- }
- return nil
-}
-
func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command) error {
// do it only after podman has already re-execed and running with uid==0.
if os.Geteuid() == 0 {
diff --git a/pkg/domain/infra/abi/system_novalink.go b/pkg/domain/infra/abi/system_novalink.go
new file mode 100644
index 000000000..a71b0170a
--- /dev/null
+++ b/pkg/domain/infra/abi/system_novalink.go
@@ -0,0 +1,14 @@
+// +build !varlink
+
+package abi
+
+import (
+ "context"
+
+ "github.com/containers/libpod/pkg/domain/entities"
+ "github.com/pkg/errors"
+)
+
+func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.ServiceOptions) error {
+ return errors.Errorf("varlink is not supported")
+}
diff --git a/pkg/domain/infra/abi/system_varlink.go b/pkg/domain/infra/abi/system_varlink.go
new file mode 100644
index 000000000..c0144babe
--- /dev/null
+++ b/pkg/domain/infra/abi/system_varlink.go
@@ -0,0 +1,49 @@
+// +build varlink
+
+package abi
+
+import (
+ "context"
+
+ "github.com/containers/libpod/pkg/domain/entities"
+ iopodman "github.com/containers/libpod/pkg/varlink"
+ iopodmanAPI "github.com/containers/libpod/pkg/varlinkapi"
+ "github.com/containers/libpod/version"
+ "github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
+ "github.com/varlink/go/varlink"
+)
+
+func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.ServiceOptions) error {
+ var varlinkInterfaces = []*iopodman.VarlinkInterface{
+ iopodmanAPI.New(opts.Command, ic.Libpod),
+ }
+
+ service, err := varlink.NewService(
+ "Atomic",
+ "podman",
+ version.Version,
+ "https://github.com/containers/libpod",
+ )
+ if err != nil {
+ return errors.Wrapf(err, "unable to create new varlink service")
+ }
+
+ for _, i := range varlinkInterfaces {
+ if err := service.RegisterInterface(i); err != nil {
+ return errors.Errorf("unable to register varlink interface %v", i)
+ }
+ }
+
+ // Run the varlink server at the given address
+ if err = service.Listen(opts.URI, opts.Timeout); err != nil {
+ switch err.(type) {
+ case varlink.ServiceTimeoutError:
+ logrus.Infof("varlink service expired (use --timeout to increase session time beyond %s ms, 0 means never timeout)", opts.Timeout.String())
+ return nil
+ default:
+ return errors.Wrapf(err, "unable to start varlink service")
+ }
+ }
+ return nil
+}
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index 30c4a8359..beba55c2b 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -4,7 +4,9 @@ import (
"context"
"io"
"os"
+ "strconv"
"strings"
+ "time"
"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/docker/reference"
@@ -336,9 +338,36 @@ func (ic *ContainerEngine) ContainerCreate(ctx context.Context, s *specgen.SpecG
return &entities.ContainerCreateReport{Id: response.ID}, nil
}
-func (ic *ContainerEngine) ContainerLogs(ctx context.Context, containers []string, options entities.ContainerLogsOptions) error {
- // The endpoint is not ready yet and requires some more work.
- return errors.New("not implemented yet")
+func (ic *ContainerEngine) ContainerLogs(_ context.Context, nameOrIds []string, options entities.ContainerLogsOptions) error {
+ since := options.Since.Format(time.RFC3339)
+ tail := strconv.FormatInt(options.Tail, 10)
+ stdout := options.Writer != nil
+ opts := containers.LogOptions{
+ Follow: &options.Follow,
+ Since: &since,
+ Stderr: &stdout,
+ Stdout: &stdout,
+ Tail: &tail,
+ Timestamps: &options.Timestamps,
+ Until: nil,
+ }
+
+ var err error
+ outCh := make(chan string)
+ ctx, cancel := context.WithCancel(context.Background())
+ go func() {
+ err = containers.Logs(ic.ClientCxt, nameOrIds[0], opts, outCh, outCh)
+ cancel()
+ }()
+
+ for {
+ select {
+ case <-ctx.Done():
+ return err
+ case line := <-outCh:
+ _, _ = io.WriteString(options.Writer, line)
+ }
+ }
}
func (ic *ContainerEngine) ContainerAttach(ctx context.Context, nameOrId string, options entities.AttachOptions) error {
diff --git a/pkg/specgen/generate/config_linux_nocgo.go b/pkg/specgen/generate/config_linux_nocgo.go
index fc8ed206d..81d1c7011 100644
--- a/pkg/specgen/generate/config_linux_nocgo.go
+++ b/pkg/specgen/generate/config_linux_nocgo.go
@@ -5,10 +5,11 @@ package generate
import (
"errors"
+ "github.com/containers/libpod/libpod/image"
"github.com/containers/libpod/pkg/specgen"
spec "github.com/opencontainers/runtime-spec/specs-go"
)
-func (s *specgen.SpecGenerator) getSeccompConfig(configSpec *spec.Spec) (*spec.LinuxSeccomp, error) {
+func getSeccompConfig(s *specgen.SpecGenerator, configSpec *spec.Spec, img *image.Image) (*spec.LinuxSeccomp, error) {
return nil, errors.New("not implemented")
}
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2
index 1af76b4be..11c914704 100755
--- a/test/apiv2/test-apiv2
+++ b/test/apiv2/test-apiv2
@@ -270,7 +270,7 @@ function start_service() {
die "Cannot start service on non-localhost ($HOST)"
fi
- $PODMAN_BIN --root $WORKDIR system service --timeout 15 tcp:127.0.0.1:$PORT \
+ $PODMAN_BIN --root $WORKDIR system service --time 15 tcp:127.0.0.1:$PORT \
&> $WORKDIR/server.log &
service_pid=$!
diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go
index 79d18115c..dde853413 100644
--- a/test/e2e/libpod_suite_remote_test.go
+++ b/test/e2e/libpod_suite_remote_test.go
@@ -89,10 +89,17 @@ func (p *PodmanTestIntegration) StartRemoteService() {
if os.Geteuid() == 0 {
os.MkdirAll("/run/podman", 0755)
}
+
+ args := []string{}
+ if _, found := os.LookupEnv("DEBUG_SERVICE"); found {
+ args = append(args, "--log-level", "debug")
+ }
remoteSocket := p.RemoteSocket
- args := []string{"system", "service", "--timeout", "0", remoteSocket}
+ args = append(args, "system", "service", "--time", "0", remoteSocket)
podmanOptions := getRemoteOptions(p, args)
command := exec.Command(p.PodmanBinary, podmanOptions...)
+ command.Stdout = os.Stdout
+ command.Stderr = os.Stderr
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
command.Start()
command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
diff --git a/test/e2e/libpod_suite_varlink_test.go b/test/e2e/libpod_suite_varlink_test.go
index cbaed71cc..92c815b39 100644
--- a/test/e2e/libpod_suite_varlink_test.go
+++ b/test/e2e/libpod_suite_varlink_test.go
@@ -89,7 +89,7 @@ func (p *PodmanTestIntegration) StartVarlink() {
varlinkEndpoint := p.RemoteSocket
p.SetVarlinkAddress(p.RemoteSocket)
- args := []string{"varlink", "--timeout", "0", varlinkEndpoint}
+ args := []string{"varlink", "--time", "0", varlinkEndpoint}
podmanOptions := getVarlinkOptions(p, args)
command := exec.Command(p.PodmanBinary, podmanOptions...)
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go
index 8924db670..f36163ccc 100644
--- a/test/e2e/logs_test.go
+++ b/test/e2e/logs_test.go
@@ -9,6 +9,7 @@ import (
. "github.com/containers/libpod/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
+ . "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman logs", func() {
@@ -19,7 +20,6 @@ var _ = Describe("Podman logs", func() {
)
BeforeEach(func() {
- SkipIfRemote() // v2remotefail
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -36,97 +36,99 @@ var _ = Describe("Podman logs", func() {
})
- It("podman logs for container", func() {
+ It("all lines", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
- cid := logc.OutputToString()
+ Expect(logc).To(Exit(0))
+ cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman logs tail two lines", func() {
+ It("tail two lines", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "2", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(2))
})
- It("podman logs tail zero lines", func() {
+ It("tail zero lines", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "0", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(0))
})
- It("podman logs tail 99 lines", func() {
+ It("tail 99 lines", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "99", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman logs tail 2 lines with timestamps", func() {
+ It("tail 2 lines with timestamps", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "2", "-t", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(2))
})
- It("podman logs latest with since time", func() {
+ It("since time 2017-08-07", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--since", "2017-08-07T10:10:09.056611202-04:00", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman logs latest with since duration", func() {
+ It("since duration 10m", func() {
logc := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--since", "10m", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman logs latest and container name should fail", func() {
+ It("latest and container name should fail", func() {
+ SkipIfRemote() // -l not supported
results := podmanTest.Podman([]string{"logs", "-l", "foobar"})
results.WaitWithDefaultTimeout()
Expect(results).To(ExitWithError())
})
- It("podman logs two containers and should display short container IDs", func() {
+ It("two containers showing short container IDs", func() {
+ SkipIfRemote() // remote does not support multiple containers
log1 := podmanTest.Podman([]string{"run", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
log1.WaitWithDefaultTimeout()
Expect(log1.ExitCode()).To(Equal(0))
@@ -139,7 +141,7 @@ var _ = Describe("Podman logs", func() {
results := podmanTest.Podman([]string{"logs", cid1, cid2})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).Should(Exit(0))
output := results.OutputToStringArray()
Expect(len(output)).To(Equal(6))
@@ -149,23 +151,24 @@ var _ = Describe("Podman logs", func() {
It("podman logs on a created container should result in 0 exit code", func() {
session := podmanTest.Podman([]string{"create", "-dt", "--name", "log", ALPINE})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(BeZero())
+ Expect(session).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "log"})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(BeZero())
+ Expect(results).To(Exit(0))
})
- It("podman journald logs for container with container tag", func() {
+ It("using journald for container with container tag", func() {
+ SkipIfRemote()
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "--log-opt=tag={{.ImageName}}", "-d", ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", "-l"})
wait.WaitWithDefaultTimeout()
- Expect(wait.ExitCode()).To(BeZero())
+ Expect(wait).To(Exit(0))
cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_TAG", "-u", fmt.Sprintf("libpod-conmon-%s.scope", cid))
out, err := cmd.CombinedOutput()
@@ -173,17 +176,18 @@ var _ = Describe("Podman logs", func() {
Expect(string(out)).To(ContainSubstring("alpine"))
})
- It("podman journald logs for container name", func() {
+ It("using journald for container name", func() {
Skip("need to verify images have correct packages for journald")
+ SkipIfRemote()
containerName := "inside-journal"
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-d", "--name", containerName, ALPINE, "sh", "-c", "echo podman; sleep 0.1; echo podman; sleep 0.1; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
wait := podmanTest.Podman([]string{"wait", "-l"})
wait.WaitWithDefaultTimeout()
- Expect(wait.ExitCode()).To(BeZero())
+ Expect(wait).To(Exit(0))
cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_NAME", "-u", fmt.Sprintf("libpod-conmon-%s.scope", cid))
out, err := cmd.CombinedOutput()
@@ -191,98 +195,97 @@ var _ = Describe("Podman logs", func() {
Expect(string(out)).To(ContainSubstring(containerName))
})
- It("podman journald logs for container", func() {
+ It("using journald for container", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman journald logs tail two lines", func() {
+ It("using journald tail two lines", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
-
results := podmanTest.Podman([]string{"logs", "--tail", "2", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(2))
})
- It("podman journald logs tail 99 lines", func() {
+ It("using journald tail 99 lines", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "99", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman journald logs tail 2 lines with timestamps", func() {
+ It("using journald tail 2 lines with timestamps", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--tail", "2", "-t", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(2))
})
- It("podman journald logs latest with since time", func() {
+ It("using journald since time 2017-08-07", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--since", "2017-08-07T10:10:09.056611202-04:00", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman journald logs latest with since duration", func() {
+ It("using journald with duration 10m", func() {
Skip("need to verify images have correct packages for journald")
logc := podmanTest.Podman([]string{"run", "--log-driver", "journald", "-dt", ALPINE, "sh", "-c", "echo podman; echo podman; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", "--since", "10m", cid})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
- It("podman logs -f two lines", func() {
+ It("streaming output", func() {
containerName := "logs-f-rm"
logc := podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "sh", "-c", "echo podman; sleep 1; echo podman"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
results := podmanTest.Podman([]string{"logs", "-f", containerName})
results.WaitWithDefaultTimeout()
- Expect(results.ExitCode()).To(Equal(0))
+ Expect(results).To(Exit(0))
// Verify that the cleanup process worked correctly and we can recreate a container with the same name
logc = podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "true"})
logc.WaitWithDefaultTimeout()
- Expect(logc.ExitCode()).To(Equal(0))
+ Expect(logc).To(Exit(0))
})
})
diff --git a/test/endpoint/endpoint.go b/test/endpoint/endpoint.go
index 284f0d79c..6f4ae6b1f 100644
--- a/test/endpoint/endpoint.go
+++ b/test/endpoint/endpoint.go
@@ -73,7 +73,7 @@ func (p *EndpointTestIntegration) startVarlink(useImageCache bool) {
varlinkEndpoint := p.VarlinkEndpoint
//p.SetVarlinkAddress(p.RemoteSocket)
- args := []string{"varlink", "--timeout", "0", varlinkEndpoint}
+ args := []string{"varlink", "--time", "0", varlinkEndpoint}
podmanOptions := getVarlinkOptions(p, args)
if useImageCache {
cacheOptions := []string{"--storage-opt", fmt.Sprintf("%s.imagestore=%s", p.ImageCacheFS, p.ImageCacheDir)}