summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/completion.go2
-rw-r--r--cmd/podman/common/create_opts.go2
-rw-r--r--cmd/podman/common/netflags.go2
-rw-r--r--cmd/podman/containers/ps.go2
-rw-r--r--cmd/podman/containers/rm.go5
-rw-r--r--cmd/podman/images/build.go6
-rw-r--r--cmd/podman/manifest/add.go12
-rw-r--r--cmd/podman/manifest/annotate.go16
-rw-r--r--cmd/podman/manifest/create.go3
-rw-r--r--cmd/podman/manifest/inspect.go5
-rw-r--r--cmd/podman/manifest/remove.go17
-rw-r--r--cmd/podman/manifest/rm.go4
-rw-r--r--cmd/podman/networks/connect.go2
-rw-r--r--cmd/podman/networks/create.go4
-rw-r--r--cmd/podman/networks/list.go2
15 files changed, 32 insertions, 52 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index f1dea4113..2bd67bf4f 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -7,11 +7,11 @@ import (
"reflect"
"strings"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/pkg/sysregistriesv2"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/libpod/define"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/rootless"
systemdDefine "github.com/containers/podman/v3/pkg/systemd/define"
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index 297188a45..b4641ea96 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -8,11 +8,11 @@ import (
"strconv"
"strings"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/cgroups"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/libpod/define"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/api/handlers"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/rootless"
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go
index 425d85c9d..39b699812 100644
--- a/cmd/podman/common/netflags.go
+++ b/cmd/podman/common/netflags.go
@@ -3,10 +3,10 @@ package common
import (
"net"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/parse"
"github.com/containers/podman/v3/libpod/define"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/specgen"
"github.com/containers/podman/v3/pkg/specgenutil"
diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go
index cebe61b5a..c8a03ab4f 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -7,13 +7,13 @@ import (
"time"
tm "github.com/buger/goterm"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/completion"
"github.com/containers/common/pkg/report"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/utils"
"github.com/containers/podman/v3/cmd/podman/validate"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/docker/go-units"
"github.com/pkg/errors"
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index cede0ba14..a8fdee7fd 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -110,6 +110,11 @@ func rm(cmd *cobra.Command, args []string) error {
args = append(args, id)
}
+ if rmOptions.All {
+ logrus.Debug("--all is set: enforcing --depend=true")
+ rmOptions.Depend = true
+ }
+
return removeContainers(args, rmOptions, true)
}
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 751db099f..6fc73eb64 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -257,6 +257,7 @@ func build(cmd *cobra.Command, args []string) error {
return errors.Wrapf(err, "error determining path to file %q", containerFiles[i])
}
contextDir = filepath.Dir(absFile)
+ containerFiles[i] = absFile
break
}
}
@@ -289,7 +290,6 @@ func build(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
-
report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
if err != nil {
@@ -514,11 +514,10 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
opts := buildahDefine.BuildOptions{
AddCapabilities: flags.CapAdd,
AdditionalTags: tags,
+ AllPlatforms: flags.AllPlatforms,
Annotations: flags.Annotation,
Args: args,
BlobDirectory: flags.BlobCache,
- CNIConfigDir: flags.CNIConfigDir,
- CNIPluginPath: flags.CNIPlugInPath,
CommonBuildOpts: commonOpts,
Compression: compression,
ConfigureNetwork: networkPolicy,
@@ -559,6 +558,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
SystemContext: systemContext,
Target: flags.Target,
TransientMounts: flags.Volumes,
+ UnsetEnvs: flags.UnsetEnvs,
}
if flags.IgnoreFile != "" {
diff --git a/cmd/podman/manifest/add.go b/cmd/podman/manifest/add.go
index 9d219601c..d09533967 100644
--- a/cmd/podman/manifest/add.go
+++ b/cmd/podman/manifest/add.go
@@ -26,14 +26,14 @@ type manifestAddOptsWrapper struct {
var (
manifestAddOpts = manifestAddOptsWrapper{}
addCmd = &cobra.Command{
- Use: "add [options] LIST LIST",
+ Use: "add [options] LIST IMAGE [IMAGE...]",
Short: "Add images to a manifest list or image index",
Long: "Adds an image to a manifest list or image index.",
RunE: add,
+ Args: cobra.MinimumNArgs(2),
ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest add mylist:v1.11 image:v1.11-amd64
podman manifest add mylist:v1.11 transport:imageName`,
- Args: cobra.ExactArgs(2),
}
)
@@ -93,10 +93,6 @@ func add(cmd *cobra.Command, args []string) error {
return err
}
- // FIXME: (@vrothberg) this interface confuses me a lot. Why are they
- // not two arguments?
- manifestAddOpts.Images = []string{args[1], args[0]}
-
if manifestAddOpts.CredentialsCLI != "" {
creds, err := util.ParseRegistryCreds(manifestAddOpts.CredentialsCLI)
if err != nil {
@@ -114,10 +110,10 @@ func add(cmd *cobra.Command, args []string) error {
manifestAddOpts.SkipTLSVerify = types.NewOptionalBool(!manifestAddOpts.TLSVerifyCLI)
}
- listID, err := registry.ImageEngine().ManifestAdd(context.Background(), manifestAddOpts.ManifestAddOptions)
+ listID, err := registry.ImageEngine().ManifestAdd(context.Background(), args[0], args[1:], manifestAddOpts.ManifestAddOptions)
if err != nil {
return err
}
- fmt.Printf("%s\n", listID)
+ fmt.Println(listID)
return nil
}
diff --git a/cmd/podman/manifest/annotate.go b/cmd/podman/manifest/annotate.go
index d806ce9e6..a032a1fe5 100644
--- a/cmd/podman/manifest/annotate.go
+++ b/cmd/podman/manifest/annotate.go
@@ -1,14 +1,12 @@
package manifest
import (
- "context"
"fmt"
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/pkg/domain/entities"
- "github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -20,8 +18,8 @@ var (
Short: "Add or update information about an entry in a manifest list or image index",
Long: "Adds or updates information about an entry in a manifest list or image index.",
RunE: annotate,
- Example: `podman manifest annotate --annotation left=right mylist:v1.11 image:v1.11-amd64`,
Args: cobra.ExactArgs(2),
+ Example: `podman manifest annotate --annotation left=right mylist:v1.11 image:v1.11-amd64`,
ValidArgsFunction: common.AutocompleteImages,
}
)
@@ -63,18 +61,10 @@ func init() {
}
func annotate(cmd *cobra.Command, args []string) error {
- listImageSpec := args[0]
- instanceSpec := args[1]
- if listImageSpec == "" {
- return errors.Errorf(`invalid image name "%s"`, listImageSpec)
- }
- if instanceSpec == "" {
- return errors.Errorf(`invalid image digest "%s"`, instanceSpec)
- }
- updatedListID, err := registry.ImageEngine().ManifestAnnotate(context.Background(), args, manifestAnnotateOpts)
+ id, err := registry.ImageEngine().ManifestAnnotate(registry.Context(), args[0], args[1], manifestAnnotateOpts)
if err != nil {
return err
}
- fmt.Printf("%s\n", updatedListID)
+ fmt.Println(id)
return nil
}
diff --git a/cmd/podman/manifest/create.go b/cmd/podman/manifest/create.go
index 95c9f89b0..acef53045 100644
--- a/cmd/podman/manifest/create.go
+++ b/cmd/podman/manifest/create.go
@@ -1,7 +1,6 @@
package manifest
import (
- "context"
"fmt"
"github.com/containers/podman/v3/cmd/podman/common"
@@ -36,7 +35,7 @@ func init() {
}
func create(cmd *cobra.Command, args []string) error {
- imageID, err := registry.ImageEngine().ManifestCreate(context.Background(), args[:1], args[1:], manifestCreateOpts)
+ imageID, err := registry.ImageEngine().ManifestCreate(registry.Context(), args[0], args[1:], manifestCreateOpts)
if err != nil {
return err
}
diff --git a/cmd/podman/manifest/inspect.go b/cmd/podman/manifest/inspect.go
index d444f9066..ac8ee3dc4 100644
--- a/cmd/podman/manifest/inspect.go
+++ b/cmd/podman/manifest/inspect.go
@@ -1,7 +1,6 @@
package manifest
import (
- "context"
"fmt"
"github.com/containers/podman/v3/cmd/podman/common"
@@ -29,10 +28,10 @@ func init() {
}
func inspect(cmd *cobra.Command, args []string) error {
- buf, err := registry.ImageEngine().ManifestInspect(context.Background(), args[0])
+ buf, err := registry.ImageEngine().ManifestInspect(registry.Context(), args[0])
if err != nil {
return err
}
- fmt.Printf("%s\n", buf)
+ fmt.Println(string(buf))
return nil
}
diff --git a/cmd/podman/manifest/remove.go b/cmd/podman/manifest/remove.go
index c44c0991e..4716af201 100644
--- a/cmd/podman/manifest/remove.go
+++ b/cmd/podman/manifest/remove.go
@@ -1,7 +1,6 @@
package manifest
import (
- "context"
"fmt"
"github.com/containers/podman/v3/cmd/podman/common"
@@ -16,9 +15,9 @@ var (
Short: "Remove an entry from a manifest list or image index",
Long: "Removes an image from a manifest list or image index.",
RunE: remove,
+ Args: cobra.ExactArgs(2),
ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest remove mylist:v1.11 sha256:15352d97781ffdf357bf3459c037be3efac4133dc9070c2dce7eca7c05c3e736`,
- Args: cobra.ExactArgs(2),
}
)
@@ -30,18 +29,10 @@ func init() {
}
func remove(cmd *cobra.Command, args []string) error {
- listImageSpec := args[0]
- instanceSpec := args[1]
- if listImageSpec == "" {
- return errors.Errorf(`invalid image name "%s"`, listImageSpec)
- }
- if instanceSpec == "" {
- return errors.Errorf(`invalid image digest "%s"`, instanceSpec)
- }
- updatedListID, err := registry.ImageEngine().ManifestRemove(context.Background(), args)
+ updatedListID, err := registry.ImageEngine().ManifestRemoveDigest(registry.Context(), args[0], args[1])
if err != nil {
- return errors.Wrapf(err, "error removing from manifest list %s", listImageSpec)
+ return errors.Wrapf(err, "error removing from manifest list %s", args[0])
}
- fmt.Printf("%s\n", updatedListID)
+ fmt.Println(updatedListID)
return nil
}
diff --git a/cmd/podman/manifest/rm.go b/cmd/podman/manifest/rm.go
index 5e78197ed..b4a52653b 100644
--- a/cmd/podman/manifest/rm.go
+++ b/cmd/podman/manifest/rm.go
@@ -12,13 +12,13 @@ import (
var (
rmCmd = &cobra.Command{
- Use: "rm LIST",
+ Use: "rm LIST [LIST...]",
Short: "Remove manifest list or image index from local storage",
Long: "Remove manifest list or image index from local storage.",
RunE: rm,
+ Args: cobra.MinimumNArgs(1),
ValidArgsFunction: common.AutocompleteImages,
Example: `podman manifest rm mylist:v1.11`,
- Args: cobra.ExactArgs(1),
}
)
diff --git a/cmd/podman/networks/connect.go b/cmd/podman/networks/connect.go
index b0ffbfe6d..b0eece06c 100644
--- a/cmd/podman/networks/connect.go
+++ b/cmd/podman/networks/connect.go
@@ -3,10 +3,10 @@ package network
import (
"net"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/spf13/cobra"
)
diff --git a/cmd/podman/networks/create.go b/cmd/podman/networks/create.go
index 21d720f55..ad1f9cbd0 100644
--- a/cmd/podman/networks/create.go
+++ b/cmd/podman/networks/create.go
@@ -4,12 +4,12 @@ import (
"fmt"
"net"
+ "github.com/containers/common/libnetwork/types"
+ "github.com/containers/common/libnetwork/util"
"github.com/containers/common/pkg/completion"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/parse"
"github.com/containers/podman/v3/cmd/podman/registry"
- "github.com/containers/podman/v3/libpod/network/types"
- "github.com/containers/podman/v3/libpod/network/util"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
diff --git a/cmd/podman/networks/list.go b/cmd/podman/networks/list.go
index 7ce566225..b84c9f5d3 100644
--- a/cmd/podman/networks/list.go
+++ b/cmd/podman/networks/list.go
@@ -6,12 +6,12 @@ import (
"sort"
"strings"
+ "github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/completion"
"github.com/containers/common/pkg/report"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
"github.com/containers/podman/v3/cmd/podman/validate"
- "github.com/containers/podman/v3/libpod/network/types"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors"
"github.com/spf13/cobra"