Skip to content

Commit

Permalink
Merge pull request #232 from ivanilves/issue-231
Browse files Browse the repository at this point in the history
fix(issue-231): "nil *Token pointer" panic
  • Loading branch information
ivanilves committed Jul 21, 2021
2 parents a7d5143 + 97a7299 commit 1275cee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
command: |
SSH_HOST=$(echo ${DOCKER_HOST} | sed 's|.*://||;s|:.*||;')
ssh-keyscan ${SSH_HOST} >>~/.ssh/known_hosts
ssh -C2TnN -4 -D 9050 -i ~/.ssh/id_rsa_circleci_remote_docker_engine ${SSH_HOST}
ssh -C2TnN -4 -D 9050 -i ~/.ssh/id_rsa* ${SSH_HOST}
- run:
name: Wait for SSH tunnel to become available
environment:
Expand Down
3 changes: 2 additions & 1 deletion api/v1/registry/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"net/http"
"reflect"
"time"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -176,7 +177,7 @@ func decodeAllTagData(body io.ReadCloser) ([]string, map[string]manifest.Manifes
}

func (cli *RegistryClient) repoToken(repoPath string) (auth.Token, error) {
if cli.Token != nil && cli.Token.Method() != "Bearer" {
if cli.Token != nil && !reflect.ValueOf(cli.Token).IsNil() && cli.Token.Method() != "Bearer" {
return cli.Token, nil
}

Expand Down

0 comments on commit 1275cee

Please sign in to comment.