Skip to content

Commit

Permalink
refactor: remove schema1 manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys3 committed Nov 17, 2023
1 parent c42eae4 commit 2816013
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 147 deletions.
8 changes: 4 additions & 4 deletions clair/layerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ func (c *Clair) getLayers(ctx context.Context, r *registry.Registry, repo, tag s
return filteredLayers, mf.Config.Digest.String(), nil
}

m, err := r.ManifestV1(ctx, repo, tag)
m, err := r.ManifestOCI(ctx, repo, tag)
if err != nil {
return nil, "", fmt.Errorf("getting the v1 manifest for %s:%s failed: %v", repo, tag, err)
}

for i := 0; i < len(m.FSLayers); i++ {
if filterEmpty && IsEmptyLayer(m.FSLayers[i].BlobSum) {
for i := 0; i < len(m.Layers); i++ {
if filterEmpty && IsEmptyLayer(m.Layers[i].Digest) {
continue
} else {
filteredLayers[i] = distribution.Descriptor{
Digest: m.FSLayers[i].BlobSum,
Digest: m.Layers[i].Digest,
}
}
}
Expand Down
54 changes: 28 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
module github.com/genuinetools/reg

go 1.19
go 1.21

require (
github.com/distribution/distribution/v3 v3.0.0-20230131081513-cf87e8d07e8d
github.com/docker/cli v23.0.1+incompatible
github.com/docker/docker v23.0.1+incompatible
github.com/distribution/distribution/v3 v3.0.0-20231117130607-9610a1e618a8
github.com/distribution/reference v0.5.0
github.com/docker/cli v24.0.7+incompatible
github.com/docker/docker v24.0.7+incompatible
github.com/dustin/go-humanize v1.0.1
github.com/genuinetools/pkg v0.0.0-20181022210355-2fcf164d37cb
github.com/google/go-cmp v0.5.9
github.com/labstack/echo/v4 v4.10.0
github.com/labstack/echo/v4 v4.11.3
github.com/mitchellh/go-wordwrap v1.0.1
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd
github.com/moby/term v0.5.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2
github.com/peterhellberg/link v1.2.0
github.com/quay/clair/v3 v3.0.0-pre1
github.com/sirupsen/logrus v1.9.0
google.golang.org/grpc v1.53.0
github.com/sirupsen/logrus v1.9.3
google.golang.org/grpc v1.59.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.8.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/fernet/fernet-go v0.0.0-20211208181803-9f70042a33ee // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/labstack/gommon v0.4.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect
google.golang.org/protobuf v1.28.1 // indirect
golang.org/x/crypto v0.15.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
)
Loading

0 comments on commit 2816013

Please sign in to comment.