Skip to content

Commit

Permalink
Merge pull request #851 from replicatedhq/kotsadm-panic-containers-image
Browse files Browse the repository at this point in the history
Update github.com/containers/image dependency to fix panic
  • Loading branch information
emosbaugh committed Jul 24, 2020
2 parents 5622327 + a597ade commit 93d9a9b
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 17 deletions.
1 change: 1 addition & 0 deletions go.mod
Expand Up @@ -19,6 +19,7 @@ require (
github.com/bugsnag/panicwrap v1.2.0 // indirect
github.com/containerd/continuity v0.0.0-20200228182428-0f16d7a0959c // indirect
github.com/containers/image v3.0.2+incompatible
github.com/containers/image/v5 v5.2.0
github.com/containers/storage v1.16.2 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/docker/distribution v2.7.1+incompatible
Expand Down
40 changes: 40 additions & 0 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion kotsadm/go.mod
Expand Up @@ -18,7 +18,7 @@ require (
github.com/lib/pq v1.3.0
github.com/marccampbell/yaml-toolbox v0.0.0-20200328202846-85b6f7184a20
github.com/mholt/archiver v3.1.1+incompatible
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
github.com/pkg/errors v0.9.1
github.com/replicatedhq/kots v0.0.0-00010101000000-000000000000
github.com/replicatedhq/troubleshoot v0.9.38
Expand Down
38 changes: 38 additions & 0 deletions kotsadm/go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/base/images.go
Expand Up @@ -3,8 +3,8 @@ package base
import (
"fmt"

imagedocker "github.com/containers/image/docker"
dockerref "github.com/containers/image/docker/reference"
imagedocker "github.com/containers/image/v5/docker"
dockerref "github.com/containers/image/v5/docker/reference"
"github.com/pkg/errors"
kotsv1beta1 "github.com/replicatedhq/kots/kotskinds/apis/kots/v1beta1"
"github.com/replicatedhq/kots/pkg/docker/registry"
Expand Down
4 changes: 2 additions & 2 deletions pkg/docker/registry/auth.go
Expand Up @@ -9,8 +9,8 @@ import (
"net/url"
"strings"

"github.com/containers/image/pkg/docker/config"
"github.com/containers/image/types"
"github.com/containers/image/v5/pkg/docker/config"
"github.com/containers/image/v5/types"
"github.com/docker/distribution/registry/client/auth/challenge"
"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/logger"
Expand Down
14 changes: 7 additions & 7 deletions pkg/image/builder.go
Expand Up @@ -12,12 +12,12 @@ import (
"path/filepath"
"strings"

"github.com/containers/image/copy"
imagedocker "github.com/containers/image/docker"
dockerref "github.com/containers/image/docker/reference"
"github.com/containers/image/signature"
"github.com/containers/image/transports/alltransports"
"github.com/containers/image/types"
"github.com/containers/image/v5/copy"
imagedocker "github.com/containers/image/v5/docker"
dockerref "github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/signature"
"github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types"
"github.com/docker/distribution/reference"
"github.com/docker/distribution/registry/api/errcode"
"github.com/pkg/errors"
Expand Down Expand Up @@ -585,7 +585,7 @@ func isUnauthorized(err error) bool {
return err.Code.Descriptor().HTTPStatusCode == http.StatusUnauthorized
}

if err == imagedocker.ErrUnauthorizedForCredentials {
if _, ok := err.(imagedocker.ErrUnauthorizedForCredentials); ok {
return true
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/kotsadm/push_images.go
Expand Up @@ -10,10 +10,10 @@ import (
"os"
"path/filepath"

"github.com/containers/image/copy"
"github.com/containers/image/signature"
"github.com/containers/image/transports/alltransports"
containerstypes "github.com/containers/image/types"
"github.com/containers/image/v5/copy"
"github.com/containers/image/v5/signature"
"github.com/containers/image/v5/transports/alltransports"
containerstypes "github.com/containers/image/v5/types"
"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/kotsadm/types"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/upstream/push_images.go
Expand Up @@ -14,7 +14,7 @@ import (
"strings"
"time"

"github.com/containers/image/docker/tarfile"
"github.com/containers/image/v5/docker/tarfile"
"github.com/pkg/errors"
"github.com/replicatedhq/kots/pkg/docker/registry"
"github.com/replicatedhq/kots/pkg/image"
Expand Down

0 comments on commit 93d9a9b

Please sign in to comment.