Skip to content

Commit

Permalink
Add note about parsing images with digest
Browse files Browse the repository at this point in the history
Signed-off-by: AbdelrahmanElawady <[email protected]>
  • Loading branch information
AbdelrahmanElawady committed May 8, 2024
1 parent ff14faf commit 7378ee1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ Go library to handle references to container images.

This repository contains a library for handling references to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details.

## Usage

Make sure to import hash implementation when parsing images with digest in a non-test file. For example:

```go
import (
_ "crypto/sha256"
_ "crypto/sha512"
)
```

## Contribution

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute
Expand Down
3 changes: 3 additions & 0 deletions reference.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Package reference provides a general type to represent any way of referencing images within the registry.
// Its main purpose is to abstract tags and digests (content-addressable hash).
//
// Note: Hash implementation packages must be imported in order
// for digest parsing to work. Example package for sha256: [crypto/sha256]
//
// Grammar
//
// reference := name [ ":" tag ] [ "@" digest ]
Expand Down

0 comments on commit 7378ee1

Please sign in to comment.