Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker 19.03.8 #7351

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions drivers/docker/driver_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package docker

import (
"github.com/docker/docker/daemon/caps"
"github.com/docker/docker/oci/caps"
docker "github.com/fsouza/go-dockerclient"
)

Expand All @@ -19,7 +19,7 @@ func tweakCapabilities(basics, adds, drops []string) ([]string, error) {
basics[i] = "CAP_" + cap
}

effectiveCaps, err := caps.TweakCapabilities(basics, adds, drops)
effectiveCaps, err := caps.TweakCapabilities(basics, adds, drops, nil, false)
if err != nil {
return effectiveCaps, err
}
Expand Down
26 changes: 25 additions & 1 deletion drivers/docker/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
"strings"

"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/config/types"
"github.com/docker/distribution/reference"
registrytypes "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/registry"
docker "github.com/fsouza/go-dockerclient"
)
Expand Down Expand Up @@ -115,7 +117,7 @@ func authFromDockerConfig(file string) authBackend {

return firstValidAuth(repo, []authBackend{
func(string) (*docker.AuthConfiguration, error) {
dockerAuthConfig := registry.ResolveAuthConfig(cfile.AuthConfigs, repoInfo.Index)
dockerAuthConfig := registryResolveAuthConfig(cfile.AuthConfigs, repoInfo.Index)
auth := &docker.AuthConfiguration{
Username: dockerAuthConfig.Username,
Password: dockerAuthConfig.Password,
Expand Down Expand Up @@ -268,3 +270,25 @@ func parseVolumeSpecLinux(volBind string) (hostPath string, containerPath string

return parts[0], parts[1], m, nil
}

// ResolveAuthConfig matches an auth configuration to a server address or a URL
// copied from https://github.com/moby/moby/blob/ca20bc4214e6a13a5f134fb0d2f67c38065283a8/registry/auth.go#L217-L235
// but with the CLI types.AuthConfig type rather than api/types
func registryResolveAuthConfig(authConfigs map[string]types.AuthConfig, index *registrytypes.IndexInfo) types.AuthConfig {
configKey := registry.GetAuthConfigKey(index)
// First try the happy case
if c, found := authConfigs[configKey]; found || index.Official {
return c
}

// Maybe they have a legacy config file, we will iterate the keys converting
// them to the new format and testing
for r, ac := range authConfigs {
if configKey == registry.ConvertToHostname(r) {
return ac
}
}

// When all else fails, return an empty auth config
return types.AuthConfig{}
}
18 changes: 4 additions & 14 deletions vendor/github.com/containerd/continuity/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

176 changes: 176 additions & 0 deletions vendor/github.com/containerd/continuity/fs/copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading