Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ func LoadFromENV() (*RegistryConfig, error) {

viper.SetEnvPrefix("OPEN_REGISTRY")
viper.AutomaticEnv()
// err := viper.ReadInConfig()
// if err != nil {
// return nil, err
// }

config := RegistryConfig{
Debug: viper.GetBool("DEBUG"),
Expand Down
31 changes: 0 additions & 31 deletions registry/v2/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,6 @@ func (b *blobs) errorResponse(code, msg string, detail map[string]interface{}) [
return bz
}

//func (b *blobs) get(namespace string) (map[string][]byte, bool) {
// digests, ok := b.layers[namespace]
// if !ok {
// return nil, false
// }
//
// layers := make(map[string][]byte)
// for _, d := range digests {
// blob, ok := b.contents[d]
// if !ok {
// return nil, false
// }
// layers[d] = blob
// }
//
// return layers, true
//}
//

//func (b *blobs) remove(repo string) {
// digests, ok := b.layers[repo]
// if !ok {
// return
// }
// delete(b.layers, repo)
//
// for _, d := range digests {
// delete(b.contents, d)
// }
//}

func (b *blobs) HEAD(ctx echo.Context) error {
digest := ctx.Param("digest")
layerRef, err := b.registry.localCache.GetDigest(digest)
Expand Down
19 changes: 0 additions & 19 deletions registry/v2/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,6 @@ func (r *registry) errorResponse(code, msg string, detail map[string]interface{}
return bz
}

//func (r *registry) getDigestFromURI(u *url.URL) (string, *RegistryError) {
//
// elem := strings.Split(u.Path, "/")
// elem = elem[1:]
// if elem[len(elem)-1] == "" {
// elem = elem[:len(elem)-1]
// }
// // Must have a path of form /v2/{name}/blobs/{upload,sha256:}
// if len(elem) < 4 {
// return "", &RegistryError{
// Code: RegistryErrorCodeNameInvalid,
// Message: "blobs must be attached to a repo",
// Detail: map[string]interface{}{},
// }
// }
//
// return elem[len(elem)-1], nil
//}

func digest(bz []byte) string {
hash := sha256.New()
_, err := hash.Write(bz)
Expand Down