Vendor in latest containers/image
Adds support for credential helpers Signed-off-by: umohnani8 <umohnani@redhat.com>
This commit is contained in:
parent
8538c4067a
commit
e9467dc540
24 changed files with 1405 additions and 10 deletions
41
vendor/github.com/docker/docker-credential-helpers/osxkeychain/url_non_go18.go
generated
vendored
Normal file
41
vendor/github.com/docker/docker-credential-helpers/osxkeychain/url_non_go18.go
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
//+build !go1.8
|
||||
|
||||
package osxkeychain
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func getHostname(u *url.URL) string {
|
||||
return stripPort(u.Host)
|
||||
}
|
||||
|
||||
func getPort(u *url.URL) string {
|
||||
return portOnly(u.Host)
|
||||
}
|
||||
|
||||
func stripPort(hostport string) string {
|
||||
colon := strings.IndexByte(hostport, ':')
|
||||
if colon == -1 {
|
||||
return hostport
|
||||
}
|
||||
if i := strings.IndexByte(hostport, ']'); i != -1 {
|
||||
return strings.TrimPrefix(hostport[:i], "[")
|
||||
}
|
||||
return hostport[:colon]
|
||||
}
|
||||
|
||||
func portOnly(hostport string) string {
|
||||
colon := strings.IndexByte(hostport, ':')
|
||||
if colon == -1 {
|
||||
return ""
|
||||
}
|
||||
if i := strings.Index(hostport, "]:"); i != -1 {
|
||||
return hostport[i+len("]:"):]
|
||||
}
|
||||
if strings.Contains(hostport, "]") {
|
||||
return ""
|
||||
}
|
||||
return hostport[colon+len(":"):]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue