Skip to content

Commit

Permalink
revert manifest.go
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Mar 23, 2023
1 parent c4602de commit 2900894
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/registry/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"io"
"log"
"math/rand"
"net/http"
"sort"
"strconv"
Expand Down Expand Up @@ -90,21 +89,9 @@ func isReferrers(req *http.Request) bool {
return elems[len(elems)-2] == "referrers"
}

var msgs = []string{
"This image is deprecated and will be removed in 17 days.",
"This image has 3 critical CVEs -- consider upgrading to :v1.2.5 as soon as possible",
"Your auth token will expire in 30 seconds.",
"Did you know: The woolly mammoth was still around when the pyramids were being built.",
}

// https://github.com/opencontainers/distribution-spec/blob/master/spec.md#pulling-an-image-manifest
// https://github.com/opencontainers/distribution-spec/blob/master/spec.md#pushing-an-image
func (m *manifests) handle(resp http.ResponseWriter, req *http.Request) *regError {

if rand.Intn(5) == 1 {
resp.Header().Set("Warning", msgs[rand.Intn(len(msgs))])
}

elem := strings.Split(req.URL.Path, "/")
elem = elem[1:]
target := elem[len(elem)-1]
Expand Down

0 comments on commit 2900894

Please sign in to comment.