Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-06-06 14:24:58 -04:00
parent 9534afc84a
commit 307f7c8400
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
3 changed files with 7 additions and 13 deletions

View file

@ -107,7 +107,7 @@ latest
stable
```
## Get a Manifest
### Get a Manifest
```console
$ reg manifest htop
@ -128,7 +128,7 @@ $ reg manifest htop
}
```
## Get the Digest
### Get the Digest
```console
$ reg digest htop
sha256:791158756cc0f5b27ef8c5c546284568fc9b7f4cf1429fb736aff3ee2d2e340f

View file

@ -1,7 +1,6 @@
package main
import (
"encoding/json"
"fmt"
"github.com/genuinetools/reg/repoutils"
@ -10,7 +9,7 @@ import (
var digestCommand = cli.Command{
Name: "digest",
Usage: "get the Docker-Content-Digest",
Usage: "get the digest",
Action: func(c *cli.Context) error {
if len(c.Args()) < 1 {
return fmt.Errorf("pass the name of the repository")
@ -21,18 +20,12 @@ var digestCommand = cli.Command{
return err
}
var digest interface{}
digest, err = r.Digest(repo, ref)
digest, err := r.Digest(repo, ref)
if err != nil {
return err
}
b, err := json.MarshalIndent(digest, " ", " ")
if err != nil {
return err
}
fmt.Println(string(b))
fmt.Println(digest)
return nil
},

View file

@ -7,6 +7,7 @@ import (
"github.com/docker/distribution/reference"
"github.com/docker/docker-ce/components/cli/cli/config"
"github.com/docker/docker/api/types"
"github.com/sirupsen/logrus"
)
const (
@ -80,7 +81,7 @@ func GetAuthConfig(username, password, registry string) (types.AuthConfig, error
}
}
fmt.Printf("Using registry %q with no authentication\n", registry)
logrus.Debugf("Using registry %q with no authentication", registry)
// Otherwise just use the registry with no auth.
return setDefaultRegistry(types.AuthConfig{