Skip to content

Commit 89e02ef

Browse files
build(deps): bump oras.land/oras-go/v2 from 2.3.0 to 2.3.1 (open-policy-agent#6337)
Bumps [oras.land/oras-go/v2](https://github.com/oras-project/oras-go) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/oras-project/oras-go/releases) - [Commits](oras-project/oras-go@v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: oras.land/oras-go/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 1246ad2 commit 89e02ef

File tree

12 files changed

+44
-36
lines changed

12 files changed

+44
-36
lines changed

Diff for: go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/gorilla/mux v1.8.0
2222
github.com/olekukonko/tablewriter v0.0.5
2323
github.com/opencontainers/go-digest v1.0.0
24-
github.com/opencontainers/image-spec v1.1.0-rc4
24+
github.com/opencontainers/image-spec v1.1.0-rc5
2525
github.com/peterh/liner v1.2.2
2626
github.com/prometheus/client_golang v1.16.0
2727
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
@@ -43,7 +43,7 @@ require (
4343
google.golang.org/grpc v1.59.0
4444
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
4545
gopkg.in/yaml.v2 v2.4.0
46-
oras.land/oras-go/v2 v2.3.0
46+
oras.land/oras-go/v2 v2.3.1
4747
sigs.k8s.io/yaml v1.3.0
4848
)
4949

@@ -87,7 +87,7 @@ require (
8787
go.opencensus.io v0.24.0 // indirect
8888
go.opentelemetry.io/otel/metric v1.19.0 // indirect
8989
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
90-
golang.org/x/sync v0.3.0 // indirect
90+
golang.org/x/sync v0.4.0 // indirect
9191
golang.org/x/sys v0.13.0 // indirect
9292
golang.org/x/text v0.13.0 // indirect
9393
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect

Diff for: go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
156156
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
157157
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
158158
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
159-
github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0=
160-
github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
159+
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
160+
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
161161
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
162162
github.com/peterh/liner v1.2.2 h1:aJ4AOodmL+JxOZZEL2u9iJf8omNRpqHc/EbrK+3mAXw=
163163
github.com/peterh/liner v1.2.2/go.mod h1:xFwJyiKIXJZUKItq5dGHZSTBRAuG/CpeNpWLyiNRNwI=
@@ -279,8 +279,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
279279
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
280280
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
281281
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
282-
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
283-
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
282+
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
283+
golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
284284
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
285285
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
286286
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -363,7 +363,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
363363
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
364364
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
365365
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
366-
oras.land/oras-go/v2 v2.3.0 h1:lqX1aXdN+DAmDTKjiDyvq85cIaI4RkIKp/PghWlAGIU=
367-
oras.land/oras-go/v2 v2.3.0/go.mod h1:GeAwLuC4G/JpNwkd+bSZ6SkDMGaaYglt6YK2WvZP7uQ=
366+
oras.land/oras-go/v2 v2.3.1 h1:lUC6q8RkeRReANEERLfH86iwGn55lbSWP20egdFHVec=
367+
oras.land/oras-go/v2 v2.3.1/go.mod h1:5AQXVEu1X/FKp1F9DMOb5ZItZBOa0y5dha0yCm4NR9c=
368368
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
369369
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

Diff for: vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/github.com/opencontainers/image-spec/specs-go/version.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: vendor/modules.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ github.com/olekukonko/tablewriter
195195
# github.com/opencontainers/go-digest v1.0.0
196196
## explicit; go 1.13
197197
github.com/opencontainers/go-digest
198-
# github.com/opencontainers/image-spec v1.1.0-rc4
198+
# github.com/opencontainers/image-spec v1.1.0-rc5
199199
## explicit; go 1.18
200200
github.com/opencontainers/image-spec/specs-go
201201
github.com/opencontainers/image-spec/specs-go/v1
@@ -340,7 +340,7 @@ golang.org/x/net/internal/timeseries
340340
golang.org/x/net/ipv4
341341
golang.org/x/net/ipv6
342342
golang.org/x/net/trace
343-
# golang.org/x/sync v0.3.0
343+
# golang.org/x/sync v0.4.0
344344
## explicit; go 1.17
345345
golang.org/x/sync/errgroup
346346
golang.org/x/sync/semaphore
@@ -465,8 +465,8 @@ gopkg.in/yaml.v2
465465
# gopkg.in/yaml.v3 v3.0.1
466466
## explicit
467467
gopkg.in/yaml.v3
468-
# oras.land/oras-go/v2 v2.3.0
469-
## explicit; go 1.19
468+
# oras.land/oras-go/v2 v2.3.1
469+
## explicit; go 1.20
470470
oras.land/oras-go/v2
471471
oras.land/oras-go/v2/content
472472
oras.land/oras-go/v2/content/oci

Diff for: vendor/oras.land/oras-go/v2/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ The ORAS Go library follows [Semantic Versioning](https://semver.org/), where br
1919

2020
The version `2` is actively developed in the [`main`](https://github.com/oras-project/oras-go/tree/main) branch with all new features.
2121

22+
> [!Note]
23+
> The `main` branch follows [Go's Security Policy](https://github.com/golang/go/security/policy) and supports the two latest versions of Go (currently `1.20` and `1.21`).
24+
2225
Examples for common use cases can be found below:
2326

2427
- [Copy examples](https://pkg.go.dev/oras.land/oras-go/v2#pkg-examples)

Diff for: vendor/oras.land/oras-go/v2/SECURITY.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
Please follow the [security policy](https://oras.land/docs/community/reporting_security_concerns) to report a security vulnerability or concern.

Diff for: vendor/oras.land/oras-go/v2/content/oci/oci.go

+2-12
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ import (
3838
"oras.land/oras-go/v2/internal/resolver"
3939
)
4040

41-
// ociImageIndexFile is the file name of the index
42-
// from the OCI Image Layout Specification.
43-
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc4/image-layout.md#indexjson-file
44-
const ociImageIndexFile = "index.json"
45-
46-
// ociBlobsDir is the name of the blobs directory
47-
// from the OCI Image Layout Specification.
48-
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc4/image-layout.md#content
49-
const ociBlobsDir = "blobs"
50-
5141
// Store implements `oras.Target`, and represents a content store
5242
// based on file system with the OCI-Image layout.
5343
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc4/image-layout.md
@@ -89,13 +79,13 @@ func NewWithContext(ctx context.Context, root string) (*Store, error) {
8979
store := &Store{
9080
AutoSaveIndex: true,
9181
root: rootAbs,
92-
indexPath: filepath.Join(rootAbs, ociImageIndexFile),
82+
indexPath: filepath.Join(rootAbs, ocispec.ImageIndexFile),
9383
storage: storage,
9484
tagResolver: resolver.NewMemory(),
9585
graph: graph.NewMemory(),
9686
}
9787

98-
if err := ensureDir(filepath.Join(rootAbs, ociBlobsDir)); err != nil {
88+
if err := ensureDir(filepath.Join(rootAbs, ocispec.ImageBlobsDir)); err != nil {
9989
return nil, err
10090
}
10191
if err := store.ensureOCILayoutFile(); err != nil {

Diff for: vendor/oras.land/oras-go/v2/content/oci/readonlyoci.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func validateOCILayout(layout *ocispec.ImageLayout) error {
154154

155155
// loadIndexFile reads index.json from s.fsys.
156156
func (s *ReadOnlyStore) loadIndexFile(ctx context.Context) error {
157-
indexFile, err := s.fsys.Open(ociImageIndexFile)
157+
indexFile, err := s.fsys.Open(ocispec.ImageIndexFile)
158158
if err != nil {
159159
return fmt.Errorf("failed to open index file: %w", err)
160160
}

Diff for: vendor/oras.land/oras-go/v2/content/oci/readonlystorage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ func blobPath(dgst digest.Digest) (string, error) {
9595
return "", fmt.Errorf("cannot calculate blob path from invalid digest %s: %w: %v",
9696
dgst.String(), errdef.ErrInvalidDigest, err)
9797
}
98-
return path.Join(ociBlobsDir, dgst.Algorithm().String(), dgst.Encoded()), nil
98+
return path.Join(ocispec.ImageBlobsDir, dgst.Algorithm().String(), dgst.Encoded()), nil
9999
}

Diff for: vendor/oras.land/oras-go/v2/copy.go

+14-6
Original file line numberDiff line numberDiff line change
@@ -393,18 +393,26 @@ func prepareCopy(ctx context.Context, dst Target, dstRef string, proxy *cas.Prox
393393

394394
onCopySkipped := opts.OnCopySkipped
395395
opts.OnCopySkipped = func(ctx context.Context, desc ocispec.Descriptor) error {
396-
if onCopySkipped != nil {
397-
if err := onCopySkipped(ctx, desc); err != nil {
398-
return err
399-
}
400-
}
401396
if !content.Equal(desc, root) {
397+
if onCopySkipped != nil {
398+
return onCopySkipped(ctx, desc)
399+
}
402400
return nil
403401
}
404-
// enforce tagging when root is skipped
402+
403+
// enforce tagging when the skipped node is root
405404
if refPusher, ok := dst.(registry.ReferencePusher); ok {
405+
// NOTE: refPusher tags the node by copying it with the reference,
406+
// so onCopySkipped shouldn't be invoked in this case
406407
return copyCachedNodeWithReference(ctx, proxy, refPusher, desc, dstRef)
407408
}
409+
410+
// invoke onCopySkipped before tagging
411+
if onCopySkipped != nil {
412+
if err := onCopySkipped(ctx, desc); err != nil {
413+
return err
414+
}
415+
}
408416
return dst.Tag(ctx, root, dstRef)
409417
}
410418

0 commit comments

Comments
 (0)