mirror of
https://github.com/containers/skopeo.git
synced 2025-09-21 18:09:08 +00:00
vendor github.com/containers/image@v3.0.0
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
6
vendor/github.com/containers/image/docker/docker_client.go
generated
vendored
6
vendor/github.com/containers/image/docker/docker_client.go
generated
vendored
@@ -526,11 +526,7 @@ func (c *dockerClient) getBearerToken(ctx context.Context, challenge challenge,
|
||||
authReq.SetBasicAuth(c.username, c.password)
|
||||
}
|
||||
logrus.Debugf("%s %s", authReq.Method, authReq.URL.String())
|
||||
tr := tlsclientconfig.NewTransport()
|
||||
// TODO(runcom): insecure for now to contact the external token service
|
||||
tr.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
client := &http.Client{Transport: tr}
|
||||
res, err := client.Do(authReq)
|
||||
res, err := c.client.Do(authReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
17
vendor/github.com/containers/image/pkg/docker/config/config.go
generated
vendored
17
vendor/github.com/containers/image/pkg/docker/config/config.go
generated
vendored
@@ -46,13 +46,18 @@ func SetAuthentication(sys *types.SystemContext, registry, username, password st
|
||||
return false, setAuthToCredHelper(ch, registry, username, password)
|
||||
}
|
||||
|
||||
err := setAuthToKernelKeyring(registry, username, password)
|
||||
if err == nil {
|
||||
logrus.Debugf("credentials for (%s, %s) were stored in the kernel keyring\n", registry, username)
|
||||
return false, nil
|
||||
// Set the credentials to kernel keyring if sys.AuthFile is not specified.
|
||||
// The keyring might not work in all environments (e.g., missing capability) and isn't supported on all platforms.
|
||||
// Hence, we want to fall-back to using the authfile in case the keyring failed.
|
||||
// However, if the sys.AuthFilePath is set, we want adhere to the user specification and not use the keyring.
|
||||
if sys.AuthFilePath == "" {
|
||||
err := setAuthToKernelKeyring(registry, username, password)
|
||||
if err == nil {
|
||||
logrus.Debugf("credentials for (%s, %s) were stored in the kernel keyring\n", registry, username)
|
||||
return false, nil
|
||||
}
|
||||
logrus.Debugf("failed to authenticate with the kernel keyring, falling back to authfiles. %v", err)
|
||||
}
|
||||
logrus.Debugf("failed to authenticate with the kernel keyring, falling back to authfiles.")
|
||||
|
||||
creds := base64.StdEncoding.EncodeToString([]byte(username + ":" + password))
|
||||
newCreds := dockerAuthConfig{Auth: creds}
|
||||
auths.AuthConfigs[registry] = newCreds
|
||||
|
15
vendor/github.com/containers/image/pkg/sysregistriesv2/system_registries_v2.go
generated
vendored
15
vendor/github.com/containers/image/pkg/sysregistriesv2/system_registries_v2.go
generated
vendored
@@ -338,11 +338,24 @@ func getConfig(ctx *types.SystemContext) (*V2RegistriesConf, error) {
|
||||
configPath := ConfigPath(ctx)
|
||||
|
||||
configMutex.Lock()
|
||||
defer configMutex.Unlock()
|
||||
// if the config has already been loaded, return the cached registries
|
||||
if config, inCache := configCache[configPath]; inCache {
|
||||
configMutex.Unlock()
|
||||
return config, nil
|
||||
}
|
||||
configMutex.Unlock()
|
||||
|
||||
return TryUpdatingCache(ctx)
|
||||
}
|
||||
|
||||
// TryUpdatingCache loads the configuration from the provided `SystemContext`
|
||||
// without using the internal cache. On success, the loaded configuration will
|
||||
// be added into the internal registry cache.
|
||||
func TryUpdatingCache(ctx *types.SystemContext) (*V2RegistriesConf, error) {
|
||||
configPath := ConfigPath(ctx)
|
||||
|
||||
configMutex.Lock()
|
||||
defer configMutex.Unlock()
|
||||
|
||||
// load the config
|
||||
config, err := loadRegistryConf(configPath)
|
||||
|
6
vendor/github.com/containers/image/version/version.go
generated
vendored
6
vendor/github.com/containers/image/version/version.go
generated
vendored
@@ -4,14 +4,14 @@ import "fmt"
|
||||
|
||||
const (
|
||||
// VersionMajor is for an API incompatible changes
|
||||
VersionMajor = 2
|
||||
VersionMajor = 3
|
||||
// VersionMinor is for functionality in a backwards-compatible manner
|
||||
VersionMinor = 0
|
||||
// VersionPatch is for backwards-compatible bug fixes
|
||||
VersionPatch = 2
|
||||
VersionPatch = 0
|
||||
|
||||
// VersionDev indicates development branch. Releases will be empty string.
|
||||
VersionDev = "-dev"
|
||||
VersionDev = ""
|
||||
)
|
||||
|
||||
// Version is the specification version that the package types support.
|
||||
|
Reference in New Issue
Block a user