Update go-containerregistry

Update go-containerregistry to merge in this
[PR](https://github.com/google/go-containerregistry/pull/293) and fix
This commit is contained in:
Priya Wadhwa 2018-10-29 13:44:11 -07:00
parent ede93786a1
commit 9a1a2ef9e3
4 changed files with 10 additions and 5 deletions

5
Gopkg.lock generated
View File

@ -430,8 +430,7 @@
version = "v0.2.0"
[[projects]]
branch = "master"
digest = "1:764d0a9bb2c987d9333c5b0a256bc94791db50c0b5be2fa10f2247b1dcbd7a04"
digest = "1:f1b23f53418c1b035a5965ac2600a28b16c08643683d5213fb581ecf4e79a02a"
name = "github.com/google/go-containerregistry"
packages = [
"pkg/authn",
@ -450,7 +449,7 @@
"pkg/v1/v1util",
]
pruneopts = "NUT"
revision = "24bbadfcffb5e05b1578cb2bd5438992ada3b546"
revision = "88d8d18eb1bde1fcef23c745205c738074290515"
[[projects]]
digest = "1:f4f203acd8b11b8747bdcd91696a01dbc95ccb9e2ca2db6abf81c3a4f5e950ce"

View File

@ -35,6 +35,10 @@ required = [
name = "k8s.io/client-go"
version = "kubernetes-1.11.0"
[[constraint]]
name = "github.com/google/go-containerregistry"
revision = "88d8d18eb1bde1fcef23c745205c738074290515"
[[override]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.0"

View File

@ -39,7 +39,8 @@ func (bt *basicTransport) RoundTrip(in *http.Request) (*http.Response, error) {
// abstraction, so to avoid forwarding Authorization headers to places
// we are redirected, only set it when the authorization header matches
// the host with which we are interacting.
if in.Host == bt.target {
// In case of redirect http.Client can use an empty Host, check URL too.
if in.Host == bt.target || in.URL.Host == bt.target {
in.Header.Set("Authorization", hdr)
}
in.Header.Set("User-Agent", transportName)

View File

@ -56,7 +56,8 @@ func (bt *bearerTransport) RoundTrip(in *http.Request) (*http.Response, error) {
// abstraction, so to avoid forwarding Authorization headers to places
// we are redirected, only set it when the authorization header matches
// the registry with which we are interacting.
if in.Host == bt.registry.RegistryStr() {
// In case of redirect http.Client can use an empty Host, check URL too.
if in.Host == bt.registry.RegistryStr() || in.URL.Host == bt.registry.RegistryStr() {
in.Header.Set("Authorization", hdr)
}
in.Header.Set("User-Agent", transportName)