summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-08 17:41:48 +0200
committerGitHub <noreply@github.com>2020-05-08 17:41:48 +0200
commit2547fe53127057ce8f3ba065b4263fea32be7f0d (patch)
treeee2a6e1a9d8dc186d49a825621e2ac9cd3e06544 /vendor
parentfa7589b6a6a513b7449b59535221aaee809cb239 (diff)
parent5cbb0b8a665eb28b5b47212d35a6204d2be202fb (diff)
downloadpodman-2547fe53127057ce8f3ba065b4263fea32be7f0d.tar.gz
podman-2547fe53127057ce8f3ba065b4263fea32be7f0d.tar.bz2
podman-2547fe53127057ce8f3ba065b4263fea32be7f0d.zip
Merge pull request #6137 from rhatdan/VENDOR
Fix handling of overridden paths from database
Diffstat (limited to 'vendor')
-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
5 files changed, 39 insertions, 17 deletions
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