mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-20 03:58:32 -04:00
cleanup
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
9534afc84a
commit
307f7c8400
|
@ -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
|
||||
|
|
13
digest.go
13
digest.go
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in a new issue