mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
Merge pull request #6341 from rhatdan/build6
Attempt to turn on additional build tests
This commit is contained in:
10
.cirrus.yml
10
.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"
|
||||
|
@ -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() {
|
||||
|
@ -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},
|
||||
|
@ -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{
|
||||
|
@ -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")
|
||||
|
@ -126,6 +126,7 @@ func buildFlags(flags *pflag.FlagSet) {
|
||||
os.Exit(1)
|
||||
}
|
||||
flags.AddFlagSet(&fromAndBudFlags)
|
||||
_ = flags.MarkHidden("signature-policy")
|
||||
}
|
||||
|
||||
// build executes the build command.
|
||||
|
@ -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")
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func load(cmd *cobra.Command, args []string) error {
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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 {
|
||||
|
@ -17,6 +17,7 @@ import (
|
||||
"github.com/containers/libpod/pkg/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -31,8 +32,7 @@ Enable a listening service for API access to Podman commands.
|
||||
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`,
|
||||
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 {
|
||||
|
@ -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 {
|
||||
|
@ -1 +0,0 @@
|
||||
.so man1/podman-diff.1
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
46
docs/source/markdown/podman-image-diff.1.md
Normal file
46
docs/source/markdown/podman-image-diff.1.md
Normal file
@ -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>
|
@ -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. |
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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`.
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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).
|
||||
|
@ -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/;
|
||||
|
||||
|
@ -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 {
|
||||
|
14
pkg/domain/infra/abi/system_novalink.go
Normal file
14
pkg/domain/infra/abi/system_novalink.go
Normal file
@ -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")
|
||||
}
|
49
pkg/domain/infra/abi/system_varlink.go
Normal file
49
pkg/domain/infra/abi/system_varlink.go
Normal file
@ -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
|
||||
}
|
@ -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")
|
||||
}
|
||||
|
@ -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=$!
|
||||
|
||||
|
@ -95,7 +95,7 @@ func (p *PodmanTestIntegration) StartRemoteService() {
|
||||
args = append(args, "--log-level", "debug")
|
||||
}
|
||||
remoteSocket := p.RemoteSocket
|
||||
args = append(args, "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
|
||||
|
@ -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, " "))
|
||||
|
@ -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)}
|
||||
|
Reference in New Issue
Block a user