summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml1
-rw-r--r--Makefile4
-rw-r--r--cmd/podman/containers/stats.go1
-rw-r--r--cmd/podman/login.go1
-rw-r--r--cmd/podman/logout.go1
-rw-r--r--cmd/podman/manifest/annotate.go2
-rwxr-xr-xcontrib/cirrus/setup_environment.sh2
-rw-r--r--docs/source/markdown/podman-network-create.1.md2
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--libpod/runtime.go2
-rw-r--r--pkg/bindings/manifests/manifests.go39
-rw-r--r--pkg/bindings/test/containers_test.go4
-rw-r--r--pkg/bindings/test/manifests_test.go40
-rw-r--r--pkg/bindings/test/pods_test.go10
-rw-r--r--pkg/bindings/test/system_test.go5
-rw-r--r--pkg/domain/infra/abi/system.go1
-rw-r--r--pkg/domain/infra/tunnel/manifest.go50
-rw-r--r--pkg/specgen/generate/container.go13
-rw-r--r--test/e2e/stats_test.go20
-rw-r--r--vendor/github.com/containers/common/pkg/auth/auth.go31
-rw-r--r--vendor/github.com/containers/common/pkg/auth/cli.go11
-rw-r--r--vendor/github.com/containers/common/pkg/config/config.go10
-rw-r--r--vendor/github.com/containers/common/pkg/config/default.go2
-rw-r--r--vendor/modules.txt2
25 files changed, 155 insertions, 105 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index 2aae343e8..7400ae0a8 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -644,7 +644,6 @@ special_testing_cross_task:
special_testing_bindings_task:
- skip: $CI == 'true'
depends_on:
- "gating"
- "varlink_api"
diff --git a/Makefile b/Makefile
index 2bbae0a72..d1eb56aa8 100644
--- a/Makefile
+++ b/Makefile
@@ -377,7 +377,7 @@ MANPAGES_MD ?= $(wildcard docs/source/markdown/*.md pkg/*/docs/*.md)
MANPAGES ?= $(MANPAGES_MD:%.md=%)
MANPAGES_DEST ?= $(subst markdown,man, $(subst source,build,$(MANPAGES)))
-$(MANPAGES): %: %.md .gopathok
+$(MANPAGES): %: %.md .install.md2man docdir
@sed -e 's/\((podman.*\.md)\)//' -e 's/\[\(podman.*\)\]/\1/' $< | $(GOMD2MAN) -in /dev/stdin -out $(subst source/markdown,build/man,$@)
.PHONY: docs
@@ -385,7 +385,7 @@ docdir:
mkdir -p docs/build/man
.PHONY: docs
-docs: .install.md2man docdir $(MANPAGES) ## Generate documentation
+docs: $(MANPAGES) ## Generate documentation
.PHONE: xref_helpmsgs_manpages
xref_helpmsgs_manpages:
diff --git a/cmd/podman/containers/stats.go b/cmd/podman/containers/stats.go
index 3f9db671f..5b7f52cc7 100644
--- a/cmd/podman/containers/stats.go
+++ b/cmd/podman/containers/stats.go
@@ -234,7 +234,6 @@ func outputJSON(stats []*containerStats) error {
Pids: j.PIDS(),
})
}
-
b, err := json.MarshalIndent(jstats, "", " ")
if err != nil {
return err
diff --git a/cmd/podman/login.go b/cmd/podman/login.go
index 8413861f5..92f13d0e7 100644
--- a/cmd/podman/login.go
+++ b/cmd/podman/login.go
@@ -46,7 +46,6 @@ func init() {
// Podman flags.
flags.BoolVarP(&loginOptions.tlsVerify, "tls-verify", "", false, "Require HTTPS and verify certificates when contacting registries")
- flags.BoolVarP(&loginOptions.GetLoginSet, "get-login", "", false, "Return the current login user for the registry")
loginOptions.Stdin = os.Stdin
loginOptions.Stdout = os.Stdout
loginOptions.AcceptUnspecifiedRegistry = true
diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go
index d0afc21b4..c016de8ae 100644
--- a/cmd/podman/logout.go
+++ b/cmd/podman/logout.go
@@ -37,7 +37,6 @@ func init() {
// Flags from the auth package.
flags.AddFlagSet(auth.GetLogoutFlags(&logoutOptions))
- logoutOptions.Stdin = os.Stdin
logoutOptions.Stdout = os.Stdout
logoutOptions.AcceptUnspecifiedRegistry = true
}
diff --git a/cmd/podman/manifest/annotate.go b/cmd/podman/manifest/annotate.go
index 21d4fb747..82ee1ffda 100644
--- a/cmd/podman/manifest/annotate.go
+++ b/cmd/podman/manifest/annotate.go
@@ -24,7 +24,7 @@ var (
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
- Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode},
+ Mode: []entities.EngineMode{entities.ABIMode},
Command: annotateCmd,
Parent: manifestCmd,
})
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index 6bec9625e..756240444 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -87,7 +87,7 @@ case "$CG_FS_TYPE" in
# Normally not something to do for stable testing
# but crun is new, and late-breaking fixes may be required
# on short notice
- dnf update -y crun
+ dnf update -y crun containers-common
fi
;;
*)
diff --git a/docs/source/markdown/podman-network-create.1.md b/docs/source/markdown/podman-network-create.1.md
index cbdfee4d0..45d9d9b0b 100644
--- a/docs/source/markdown/podman-network-create.1.md
+++ b/docs/source/markdown/podman-network-create.1.md
@@ -24,7 +24,7 @@ resolution.
**-d**, **--driver**
-Driver to manage the network (default "bridge"). Currently on `bridge` is supported.
+Driver to manage the network (default "bridge"). Currently only `bridge` is supported.
**--gateway**
diff --git a/go.mod b/go.mod
index af94ad7c6..83fd19706 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
github.com/containernetworking/cni v0.7.2-0.20200304161608-4fae32b84921
github.com/containernetworking/plugins v0.8.5
github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9
- github.com/containers/common v0.11.0
+ github.com/containers/common v0.11.1
github.com/containers/conmon v2.0.14+incompatible
github.com/containers/image/v5 v5.4.3
github.com/containers/psgo v1.5.0
diff --git a/go.sum b/go.sum
index acc731805..489f17bf6 100644
--- a/go.sum
+++ b/go.sum
@@ -72,8 +72,8 @@ github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9 h1:EGegltin1
github.com/containers/buildah v1.14.9-0.20200501175434-42a48f9373d9/go.mod h1:+2aNsVcd4pVzmVAbOfWN5X+0Lpz2rtICSGXbTSCzdBU=
github.com/containers/common v0.10.0 h1:Km1foMJJBIxceA1/UCZcIuwf8sCF71sP5DwE6Oh1BEA=
github.com/containers/common v0.10.0/go.mod h1:6A/moCuQITXLqBe5A0WKKTcCfCmEQRbknI05HcPzOL0=
-github.com/containers/common v0.11.0 h1:uFSBIl9iqoTIv8icBe9lPrYKkmSiGrAWr0a2PyJLrO4=
-github.com/containers/common v0.11.0/go.mod h1:ag8p8Xp2o1wPAPz/+bA7LVQlDavtg3M15RZLBWt/2KE=
+github.com/containers/common v0.11.1 h1:i++kltFD92bKfDeE3B+Bpe5jYVTnAibmIUUUnXYKoPo=
+github.com/containers/common v0.11.1/go.mod h1:2w3QE6VUmhltGYW4wV00h4okq1Crs7hNI1ZD2I0QRUY=
github.com/containers/conmon v2.0.14+incompatible h1:knU1O1QxXy5YxtjMQVKEyCajROaehizK9FHaICl+P5Y=
github.com/containers/conmon v2.0.14+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.4.3 h1:zn2HR7uu4hpvT5QQHgjqonOzKDuM1I1UHUEmzZT5sbs=
diff --git a/libpod/runtime.go b/libpod/runtime.go
index e71483ef9..c1864683f 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -752,7 +752,7 @@ type DBConfig struct {
// mergeDBConfig merges the configuration from the database.
func (r *Runtime) mergeDBConfig(dbConfig *DBConfig) error {
- c := r.config.Engine
+ c := &r.config.Engine
if !r.storageSet.RunRootSet && dbConfig.StorageTmp != "" {
if r.storageConfig.RunRoot != dbConfig.StorageTmp &&
r.storageConfig.RunRoot != "" {
diff --git a/pkg/bindings/manifests/manifests.go b/pkg/bindings/manifests/manifests.go
index b85169410..3e0ef0325 100644
--- a/pkg/bindings/manifests/manifests.go
+++ b/pkg/bindings/manifests/manifests.go
@@ -125,23 +125,24 @@ func Push(ctx context.Context, name string, destination *string, all *bool) (str
return idr.ID, response.Process(&idr)
}
+// There is NO annotate endpoint. this binding could never work
// Annotate updates the image configuration of a given manifest list
-func Annotate(ctx context.Context, name, digest string, options image.ManifestAnnotateOpts) (string, error) {
- var idr handlers.IDResponse
- conn, err := bindings.GetClient(ctx)
- if err != nil {
- return "", err
- }
- params := url.Values{}
- params.Set("digest", digest)
- optionsString, err := jsoniter.MarshalToString(options)
- if err != nil {
- return "", err
- }
- stringReader := strings.NewReader(optionsString)
- response, err := conn.DoRequest(stringReader, http.MethodPost, "/manifests/%s/annotate", params, name)
- if err != nil {
- return "", err
- }
- return idr.ID, response.Process(&idr)
-}
+//func Annotate(ctx context.Context, name, digest string, options image.ManifestAnnotateOpts) (string, error) {
+// var idr handlers.IDResponse
+// conn, err := bindings.GetClient(ctx)
+// if err != nil {
+// return "", err
+// }
+// params := url.Values{}
+// params.Set("digest", digest)
+// optionsString, err := jsoniter.MarshalToString(options)
+// if err != nil {
+// return "", err
+// }
+// stringReader := strings.NewReader(optionsString)
+// response, err := conn.DoRequest(stringReader, http.MethodPost, "/manifests/%s/annotate", params, name)
+// if err != nil {
+// return "", err
+// }
+// return idr.ID, response.Process(&idr)
+//}
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go
index c79d89b73..f40d8ce46 100644
--- a/pkg/bindings/test/containers_test.go
+++ b/pkg/bindings/test/containers_test.go
@@ -531,7 +531,7 @@ var _ = Describe("Podman containers ", func() {
Expect(err).ToNot(BeNil())
})
- It("podman prune stoped containers", func() {
+ It("podman prune stopped containers", func() {
// Start and stop a container to enter in exited state.
var name = "top"
_, err := bt.RunTopContainer(&name, &bindings.PFalse, nil)
@@ -546,7 +546,7 @@ var _ = Describe("Podman containers ", func() {
Expect(len(pruneResponse.ID)).To(Equal(1))
})
- It("podman prune stoped containers with filters", func() {
+ It("podman prune stopped containers with filters", func() {
// Start and stop a container to enter in exited state.
var name = "top"
_, err := bt.RunTopContainer(&name, &bindings.PFalse, nil)
diff --git a/pkg/bindings/test/manifests_test.go b/pkg/bindings/test/manifests_test.go
index ddb75865c..71d626b7b 100644
--- a/pkg/bindings/test/manifests_test.go
+++ b/pkg/bindings/test/manifests_test.go
@@ -118,25 +118,27 @@ var _ = Describe("Podman containers ", func() {
Expect(len(data.Manifests)).To(BeZero())
})
- It("annotate manifest", func() {
- id, err := manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{}, nil)
- Expect(err).To(BeNil())
- opts := image.ManifestAddOpts{Images: []string{"docker.io/library/alpine:latest"}}
-
- _, err = manifests.Add(bt.conn, id, opts)
- Expect(err).To(BeNil())
- data, err := manifests.Inspect(bt.conn, id)
- Expect(err).To(BeNil())
- Expect(len(data.Manifests)).To(BeNumerically("==", 1))
- digest := data.Manifests[0].Digest.String()
- annoOpts := image.ManifestAnnotateOpts{OS: "foo"}
- _, err = manifests.Annotate(bt.conn, id, digest, annoOpts)
- Expect(err).To(BeNil())
- list, err := manifests.Inspect(bt.conn, id)
- Expect(err).To(BeNil())
- Expect(len(list.Manifests)).To(BeNumerically("==", 1))
- Expect(list.Manifests[0].Platform.OS).To(Equal("foo"))
- })
+ // There is NO annotate endpoint, this could never work.:w
+
+ //It("annotate manifest", func() {
+ // id, err := manifests.Create(bt.conn, []string{"quay.io/libpod/foobar:latest"}, []string{}, nil)
+ // Expect(err).To(BeNil())
+ // opts := image.ManifestAddOpts{Images: []string{"docker.io/library/alpine:latest"}}
+ //
+ // _, err = manifests.Add(bt.conn, id, opts)
+ // Expect(err).To(BeNil())
+ // data, err := manifests.Inspect(bt.conn, id)
+ // Expect(err).To(BeNil())
+ // Expect(len(data.Manifests)).To(BeNumerically("==", 1))
+ // digest := data.Manifests[0].Digest.String()
+ // annoOpts := image.ManifestAnnotateOpts{OS: "foo"}
+ // _, err = manifests.Annotate(bt.conn, id, digest, annoOpts)
+ // Expect(err).To(BeNil())
+ // list, err := manifests.Inspect(bt.conn, id)
+ // Expect(err).To(BeNil())
+ // Expect(len(list.Manifests)).To(BeNumerically("==", 1))
+ // Expect(list.Manifests[0].Platform.OS).To(Equal("foo"))
+ //})
It("push manifest", func() {
Skip("TODO")
diff --git a/pkg/bindings/test/pods_test.go b/pkg/bindings/test/pods_test.go
index 8a0b9c7a6..49bbfa246 100644
--- a/pkg/bindings/test/pods_test.go
+++ b/pkg/bindings/test/pods_test.go
@@ -57,6 +57,11 @@ var _ = Describe("Podman pods", func() {
podSummary, err := pods.List(bt.conn, nil)
Expect(err).To(BeNil())
Expect(len(podSummary)).To(Equal(1))
+
+ // Start the pod
+ _, err = pods.Start(bt.conn, newpod)
+ Expect(err).To(BeNil())
+
// Adding an alpine container to the existing pod
_, err = bt.RunTopContainer(nil, &bindings.PTrue, &newpod)
Expect(err).To(BeNil())
@@ -83,6 +88,11 @@ var _ = Describe("Podman pods", func() {
It("List pods with filters", func() {
newpod2 := "newpod2"
bt.Podcreate(&newpod2)
+
+ // Start the pod
+ _, err = pods.Start(bt.conn, newpod)
+ Expect(err).To(BeNil())
+
_, err = bt.RunTopContainer(nil, &bindings.PTrue, &newpod)
Expect(err).To(BeNil())
diff --git a/pkg/bindings/test/system_test.go b/pkg/bindings/test/system_test.go
index 87e6d56dc..62ea32377 100644
--- a/pkg/bindings/test/system_test.go
+++ b/pkg/bindings/test/system_test.go
@@ -3,7 +3,6 @@ package test_bindings
import (
"time"
- "github.com/containers/libpod/pkg/api/handlers"
"github.com/containers/libpod/pkg/bindings"
"github.com/containers/libpod/pkg/bindings/containers"
"github.com/containers/libpod/pkg/bindings/pods"
@@ -39,8 +38,8 @@ var _ = Describe("Podman system", func() {
})
It("podman events", func() {
- eChan := make(chan handlers.Event, 1)
- var messages []handlers.Event
+ eChan := make(chan entities.Event, 1)
+ var messages []entities.Event
cancelChan := make(chan bool, 1)
go func() {
for e := range eChan {
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go
index 692fcfa0f..24c62465f 100644
--- a/pkg/domain/infra/abi/system.go
+++ b/pkg/domain/infra/abi/system.go
@@ -86,6 +86,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command)
}
}
}
+ return nil
}
pausePidPath, err := util.GetRootlessPauseProcessPidPath()
diff --git a/pkg/domain/infra/tunnel/manifest.go b/pkg/domain/infra/tunnel/manifest.go
index 7d9a0fce1..9c1f5349a 100644
--- a/pkg/domain/infra/tunnel/manifest.go
+++ b/pkg/domain/infra/tunnel/manifest.go
@@ -64,32 +64,34 @@ func (ir *ImageEngine) ManifestAdd(ctx context.Context, opts entities.ManifestAd
return listID, nil
}
+// FIXME There is no endpoint for annotate and therefor this code is currently invalid
// ManifestAnnotate updates an entry of the manifest list
func (ir *ImageEngine) ManifestAnnotate(ctx context.Context, names []string, opts entities.ManifestAnnotateOptions) (string, error) {
- manifestAnnotateOpts := image.ManifestAnnotateOpts{
- Arch: opts.Arch,
- Features: opts.Features,
- OS: opts.OS,
- OSFeatures: opts.OSFeatures,
- OSVersion: opts.OSVersion,
- Variant: opts.Variant,
- }
- if len(opts.Annotation) > 0 {
- annotations := make(map[string]string)
- for _, annotationSpec := range opts.Annotation {
- spec := strings.SplitN(annotationSpec, "=", 2)
- if len(spec) != 2 {
- return "", errors.Errorf("no value given for annotation %q", spec[0])
- }
- annotations[spec[0]] = spec[1]
- }
- manifestAnnotateOpts.Annotation = annotations
- }
- updatedListID, err := manifests.Annotate(ctx, names[0], names[1], manifestAnnotateOpts)
- if err != nil {
- return updatedListID, errors.Wrapf(err, "error annotating %s of manifest list %s", names[1], names[0])
- }
- return fmt.Sprintf("%s :%s", updatedListID, names[1]), nil
+ return "", errors.New("not implemented")
+ // manifestAnnotateOpts := image.ManifestAnnotateOpts{
+ // Arch: opts.Arch,
+ // Features: opts.Features,
+ // OS: opts.OS,
+ // OSFeatures: opts.OSFeatures,
+ // OSVersion: opts.OSVersion,
+ // Variant: opts.Variant,
+ // }
+ // if len(opts.Annotation) > 0 {
+ // annotations := make(map[string]string)
+ // for _, annotationSpec := range opts.Annotation {
+ // spec := strings.SplitN(annotationSpec, "=", 2)
+ // if len(spec) != 2 {
+ // return "", errors.Errorf("no value given for annotation %q", spec[0])
+ // }
+ // annotations[spec[0]] = spec[1]
+ // }
+ // manifestAnnotateOpts.Annotation = annotations
+ // }
+ // updatedListID, err := manifests.Annotate(ctx, names[0], names[1], manifestAnnotateOpts)
+ // if err != nil {
+ // return updatedListID, errors.Wrapf(err, "error annotating %s of manifest list %s", names[1], names[0])
+ // }
+ // return fmt.Sprintf("%s :%s", updatedListID, names[1]), nil
}
// ManifestRemove removes the digest from manifest list
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index e4bd2991a..a217125f4 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -42,11 +42,13 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
if err != nil {
return err
}
- sig, err := signal.ParseSignalNameOrNumber(stopSignal)
- if err != nil {
- return err
+ if stopSignal != "" {
+ sig, err := signal.ParseSignalNameOrNumber(stopSignal)
+ if err != nil {
+ return err
+ }
+ s.StopSignal = &sig
}
- s.StopSignal = &sig
}
rtc, err := r.GetConfig()
@@ -78,6 +80,9 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
}
// labels from the image that dont exist already
+ if len(labels) > 0 && s.Labels == nil {
+ s.Labels = make(map[string]string)
+ }
for k, v := range labels {
if _, exists := s.Labels[k]; !exists {
s.Labels[k] = v
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index 762417a17..d3af44891 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -5,6 +5,7 @@ package integration
import (
"fmt"
"os"
+ "time"
"github.com/containers/libpod/pkg/cgroups"
. "github.com/containers/libpod/test/utils"
@@ -87,13 +88,24 @@ var _ = Describe("Podman stats", func() {
})
It("podman stats with json output", func() {
+ var found bool
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ for i := 0; i < 5; i++ {
+ ps := podmanTest.Podman([]string{"ps", "-q"})
+ ps.WaitWithDefaultTimeout()
+ if len(ps.OutputToStringArray()) == 1 {
+ found = true
+ break
+ }
+ time.Sleep(time.Second)
+ }
+ Expect(found).To(BeTrue())
+ stats := podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
+ stats.WaitWithDefaultTimeout()
+ Expect(stats.ExitCode()).To(Equal(0))
+ Expect(stats.IsJSONOutputValid()).To(BeTrue())
})
It("podman stats on a container with no net ns", func() {
diff --git a/vendor/github.com/containers/common/pkg/auth/auth.go b/vendor/github.com/containers/common/pkg/auth/auth.go
index 4e0400d23..1aa9f8b31 100644
--- a/vendor/github.com/containers/common/pkg/auth/auth.go
+++ b/vendor/github.com/containers/common/pkg/auth/auth.go
@@ -34,9 +34,32 @@ func CheckAuthFile(authfile string) error {
return nil
}
+// systemContextWithOptions returns a version of sys
+// updated with authFile and certDir values (if they are not "").
+// NOTE: this is a shallow copy that can be used and updated, but may share
+// data with the original parameter.
+func systemContextWithOptions(sys *types.SystemContext, authFile, certDir string) *types.SystemContext {
+ if sys != nil {
+ copy := *sys
+ sys = &copy
+ } else {
+ sys = &types.SystemContext{}
+ }
+
+ if authFile != "" {
+ sys.AuthFilePath = authFile
+ }
+ if certDir != "" {
+ sys.DockerCertPath = certDir
+ }
+ return sys
+}
+
// Login implements a “log in” command with the provided opts and args
// reading the password from opts.Stdin or the options in opts.
func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginOptions, args []string) error {
+ systemContext = systemContextWithOptions(systemContext, opts.AuthFile, opts.CertDir)
+
var (
server string
err error
@@ -172,6 +195,11 @@ func getUserAndPass(opts *LoginOptions, password, userFromAuthFile string) (stri
// Logout implements a “log out” command with the provided opts and args
func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []string) error {
+ if err := CheckAuthFile(opts.AuthFile); err != nil {
+ return err
+ }
+ systemContext = systemContextWithOptions(systemContext, opts.AuthFile, "")
+
var (
server string
err error
@@ -194,9 +222,6 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri
}
server = getRegistryName(args[0])
}
- if err := CheckAuthFile(opts.AuthFile); err != nil {
- return err
- }
if opts.All {
if err := config.RemoveAllAuthentication(systemContext); err != nil {
diff --git a/vendor/github.com/containers/common/pkg/auth/cli.go b/vendor/github.com/containers/common/pkg/auth/cli.go
index 3384b0731..ab033681d 100644
--- a/vendor/github.com/containers/common/pkg/auth/cli.go
+++ b/vendor/github.com/containers/common/pkg/auth/cli.go
@@ -7,16 +7,19 @@ import (
)
// LoginOptions represents common flags in login
-// caller should define bool or optionalBool fields for flags --get-login and --tls-verify
+// In addition, the caller should probably provide a --tls-verify flag (that affects the provided
+// *types.SystemContest)
type LoginOptions struct {
// CLI flags managed by the FlagSet returned by GetLoginFlags
+ // Callers that use GetLoginFlags should not need to touch these values at all; callers that use
+ // other CLI frameworks should set them based on user input.
AuthFile string
CertDir string
Password string
Username string
StdinPassword bool
+ GetLoginSet bool
// Options caller can set
- GetLoginSet bool // set to true if --get-login is explicitly set
Stdin io.Reader // set to os.Stdin
Stdout io.Writer // set to os.Stdout
AcceptUnspecifiedRegistry bool // set to true if allows login with unspecified registry
@@ -25,10 +28,11 @@ type LoginOptions struct {
// LogoutOptions represents the results for flags in logout
type LogoutOptions struct {
// CLI flags managed by the FlagSet returned by GetLogoutFlags
+ // Callers that use GetLogoutFlags should not need to touch these values at all; callers that use
+ // other CLI frameworks should set them based on user input.
AuthFile string
All bool
// Options caller can set
- Stdin io.Reader // set to os.Stdin
Stdout io.Writer // set to os.Stdout
AcceptUnspecifiedRegistry bool // set to true if allows logout with unspecified registry
}
@@ -41,6 +45,7 @@ func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet {
fs.StringVarP(&flags.Password, "password", "p", "", "Password for registry")
fs.StringVarP(&flags.Username, "username", "u", "", "Username for registry")
fs.BoolVar(&flags.StdinPassword, "password-stdin", false, "Take the password from stdin")
+ fs.BoolVar(&flags.GetLoginSet, "get-login", false, "Return the current login user for the registry")
return &fs
}
diff --git a/vendor/github.com/containers/common/pkg/config/config.go b/vendor/github.com/containers/common/pkg/config/config.go
index 0f17c27c9..611284476 100644
--- a/vendor/github.com/containers/common/pkg/config/config.go
+++ b/vendor/github.com/containers/common/pkg/config/config.go
@@ -442,16 +442,6 @@ func readConfigFromFile(path string, config *Config) (*Config, error) {
if err != nil {
return nil, fmt.Errorf("unable to decode configuration %v: %v", path, err)
}
- if config.Engine.VolumePath != "" {
- config.Engine.VolumePathSet = true
- }
- if config.Engine.StaticDir != "" {
- config.Engine.StaticDirSet = true
- }
- if config.Engine.TmpDir != "" {
- config.Engine.TmpDirSet = true
- }
-
return config, err
}
diff --git a/vendor/github.com/containers/common/pkg/config/default.go b/vendor/github.com/containers/common/pkg/config/default.go
index ec52ff706..7debd2984 100644
--- a/vendor/github.com/containers/common/pkg/config/default.go
+++ b/vendor/github.com/containers/common/pkg/config/default.go
@@ -479,6 +479,8 @@ func (c *Config) PidsLimit() int64 {
cgroup2, _ := cgroupv2.Enabled()
if cgroup2 {
return c.Containers.PidsLimit
+ } else {
+ return 0
}
}
return sysinfo.GetDefaultPidsLimit()
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 3fe9c90cb..b638d1ad0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -82,7 +82,7 @@ github.com/containers/buildah/pkg/secrets
github.com/containers/buildah/pkg/supplemented
github.com/containers/buildah/pkg/umask
github.com/containers/buildah/util
-# github.com/containers/common v0.11.0
+# github.com/containers/common v0.11.1
github.com/containers/common/pkg/apparmor
github.com/containers/common/pkg/auth
github.com/containers/common/pkg/capabilities