Skip to content

Commit a1b3391

Browse files
chore(deps): update module oras.land/oras-go/v2 to v2.6.1
Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
1 parent 5d5cb4f commit a1b3391

23 files changed

Lines changed: 392 additions & 68 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/argoproj/argo-cd/v3 v3.3.10
3333
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250308055145-5fe7bb3edc86
3434
sigs.k8s.io/controller-tools v0.16.4
35+
sigs.k8s.io/yaml v1.6.0
3536
)
3637

3738
require (
@@ -204,13 +205,12 @@ require (
204205
k8s.io/kubectl v0.35.1 // indirect
205206
k8s.io/kubernetes v1.34.2 // indirect
206207
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
207-
oras.land/oras-go/v2 v2.6.0 // indirect
208+
oras.land/oras-go/v2 v2.6.1 // indirect
208209
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
209210
sigs.k8s.io/kustomize/api v0.20.1 // indirect
210211
sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
211212
sigs.k8s.io/randfill v1.0.0 // indirect
212213
sigs.k8s.io/structured-merge-diff/v6 v6.3.1-0.20251003215857-446d8398e19c // indirect
213-
sigs.k8s.io/yaml v1.6.0 // indirect
214214
)
215215

216216
replace (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ k8s.io/kubernetes v1.34.2 h1:WQdDvYJazkmkwSncgNwGvVtaCt4TYXIU3wSMRgvp3MI=
702702
k8s.io/kubernetes v1.34.2/go.mod h1:m6pZk6a179pRo2wsTiCPORJ86iOEQmfIzUvtyEF8BwA=
703703
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
704704
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
705-
oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=
706-
oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o=
705+
oras.land/oras-go/v2 v2.6.1 h1:bonOEkjLfp8tt6qXWRRWP6p1F+9octchOf2EqnWB4Zs=
706+
oras.land/oras-go/v2 v2.6.1/go.mod h1:dhtFrFOuZuDtAVeZ9FUnaa5zfzplG3ZnFX9/uH1J/Yk=
707707
sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8=
708708
sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM=
709709
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20250308055145-5fe7bb3edc86 h1:96TA+X7D58V3065duUfj+p+Pp17q8U02+cSCmE3IsaU=

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,8 +1762,8 @@ k8s.io/utils/lru
17621762
k8s.io/utils/net
17631763
k8s.io/utils/ptr
17641764
k8s.io/utils/trace
1765-
# oras.land/oras-go/v2 v2.6.0
1766-
## explicit; go 1.23.0
1765+
# oras.land/oras-go/v2 v2.6.1
1766+
## explicit; go 1.25.0
17671767
oras.land/oras-go/v2
17681768
oras.land/oras-go/v2/content
17691769
oras.land/oras-go/v2/content/file
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright The ORAS Authors.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
version: 2
15+
16+
# oras-go is a library — no binary builds or archives needed.
17+
builds:
18+
- skip: true
19+
20+
checksum:
21+
disable: true
22+
23+
release:
24+
# Tags containing -alpha, -beta, or -rc are automatically marked pre-release.
25+
prerelease: auto
26+
draft: false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Derived from OWNERS.md
2-
* @sajayantony @shizhMSFT @stevelasker @Wwwsylvia
2+
* @sabre1041 @shizhMSFT @TerryHowe @Wwwsylvia

vendor/oras.land/oras-go/v2/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ clean:
2626
.PHONY: check-encoding
2727
check-encoding:
2828
! find . -not -path "./vendor/*" -name "*.go" -type f -exec file "{}" ";" | grep CRLF
29-
! find scripts -name "*.sh" -type f -exec file "{}" ";" | grep CRLF
3029

3130
.PHONY: fix-encoding
3231
fix-encoding:
3332
find . -not -path "./vendor/*" -name "*.go" -type f -exec sed -i -e "s/\r//g" {} +
34-
find scripts -name "*.sh" -type f -exec sed -i -e "s/\r//g" {} +
3533

3634
.PHONY: vendor
3735
vendor:
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Owners
22

33
Owners:
4-
- Sajay Antony (@sajayantony)
4+
- Andrew Block (@sabre1041)
55
- Shiwei Zhang (@shizhMSFT)
6-
- Steve Lasker (@stevelasker)
76
- Sylvia Lei (@Wwwsylvia)
7+
- Terry Howe (@TerryHowe)
88

99
Emeritus:
1010
- Avi Deitcher (@deitch)
1111
- Josh Dolitsky (@jdolitsky)
12+
- Sajay Antony (@sajayantony)
13+
- Steve Lasker (@stevelasker)

vendor/oras.land/oras-go/v2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
`oras-go` is a Go library for managing OCI artifacts, compliant with the [OCI Image Format Specification](https://github.com/opencontainers/image-spec) and the [OCI Distribution Specification](https://github.com/opencontainers/distribution-spec). It provides unified APIs for pushing, pulling, and managing artifacts across OCI-compliant registries, local file systems, and in-memory stores.
1313

1414
> [!Note]
15-
> 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.23` and `1.24`).
15+
> 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.24` and `1.25`).
1616
1717
## Getting Started
1818

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Releasing oras-go
2+
3+
Releases are created via a GitOps workflow. Merging a `release/vX.Y.Z` branch
4+
into `v2` automatically tags the commit and publishes the GitHub Release.
5+
6+
## Steps
7+
8+
### 1. Create a release branch
9+
10+
The release branch needs at least one commit so GitHub will allow a PR to be
11+
opened. Use an empty commit as a lightweight marker:
12+
13+
```bash
14+
git fetch upstream
15+
git checkout -b release/v2.7.0 upstream/v2
16+
git commit --allow-empty -s -m "chore: prepare release v2.7.0"
17+
git push origin release/v2.7.0
18+
```
19+
20+
The release does not need to contain the changes being released — those are
21+
already on `v2`. The PR is a trigger: when it merges, the workflow tags the
22+
PR's `merge_commit_sha` (the exact commit that landed on `v2`), which includes
23+
all prior work on the branch.
24+
25+
### 2. Open a pull request
26+
27+
Open a PR from `release/v2.7.0` targeting the `v2` branch. Write the release
28+
notes directly in the PR description using the format from prior releases:
29+
30+
```markdown
31+
## New Features
32+
...
33+
34+
## Bug Fixes
35+
...
36+
37+
## Documentation
38+
...
39+
40+
## Other Changes
41+
...
42+
```
43+
44+
The PR description becomes the GitHub Release body verbatim, so write it in
45+
its final form.
46+
47+
### 3. Get approvals
48+
49+
Branch protection on `v2` requires approval from at least 3 of the 4 owners
50+
listed in [OWNERS.md](OWNERS.md). Reviewers should verify:
51+
52+
- The target commit is correct
53+
- The release notes are accurate and complete
54+
- All CI checks pass
55+
56+
### 4. Merge
57+
58+
Merge the PR. The [release workflow](.github/workflows/release.yml)
59+
automatically:
60+
61+
1. Extracts the version from the branch name (`release/v2.7.0``v2.7.0`)
62+
2. Creates and pushes the git tag
63+
3. Publishes the GitHub Release with the PR body as release notes
64+
65+
## Pre-releases
66+
67+
Tags containing `-alpha`, `-beta`, or `-rc` (e.g., `v2.7.0-rc.1`) are
68+
automatically marked as pre-release on GitHub. Use the same branch naming
69+
convention: `release/v2.7.0-rc.1`.
70+
71+
## Testing the workflow locally
72+
73+
Three levels of local validation are available without triggering a real release:
74+
75+
**1. Validate the goreleaser config:**
76+
```bash
77+
goreleaser check
78+
```
79+
80+
**2. Validate workflow structure and job matching (dry run):**
81+
```bash
82+
act pull_request \
83+
-e .github/act/release-event.json \
84+
-W .github/workflows/release.yml \
85+
-n
86+
```
87+
88+
**3. Run the workflow end-to-end with a fake token (Colima + cached actions required):**
89+
```bash
90+
act pull_request \
91+
-e .github/act/release-event.json \
92+
-W .github/workflows/release.yml \
93+
-s GITHUB_TOKEN=fake \
94+
--pull=false \
95+
--action-offline-mode \
96+
--container-daemon-socket -
97+
```
98+
99+
This runs all steps up to and including version extraction (`version=vX.Y.Z` will
100+
appear in the output). The `git push` step then fails with a permission error —
101+
that is expected and confirms no tag was pushed. The mock event payload is at
102+
`.github/act/release-event.json`.
103+
104+
## Updating the documentation site
105+
106+
After a release, update [oras-www](https://github.com/oras-project/oras-www)
107+
to reflect the new version. See the `CLAUDE.md` in that repository for the
108+
exact steps.

vendor/oras.land/oras-go/v2/content/file/file.go

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
// bufPool is a pool of byte buffers that can be reused for copying content
4040
// between files.
4141
var bufPool = sync.Pool{
42-
New: func() interface{} {
42+
New: func() any {
4343
// the buffer size should be larger than or equal to 128 KiB
4444
// for performance considerations.
4545
// we choose 1 MiB here so there will be less disk I/O.
@@ -174,7 +174,7 @@ func (s *Store) Close() error {
174174
s.setClosed()
175175

176176
var errs []string
177-
s.tmpFiles.Range(func(name, _ interface{}) bool {
177+
s.tmpFiles.Range(func(name, _ any) bool {
178178
if err := os.Remove(name.(string)); err != nil {
179179
errs = append(errs, err.Error())
180180
}
@@ -625,6 +625,13 @@ func (s *Store) resolveWritePath(name string) (string, error) {
625625
if strings.HasPrefix(rel, "../") || rel == ".." {
626626
return "", ErrPathTraversalDisallowed
627627
}
628+
// The lexical check above prevents "../" escapes but does not resolve
629+
// symlinks. A symlink component under workingDir (e.g. "out" -> "/outside")
630+
// passes the lexical check yet directs writes outside workingDir.
631+
// Re-check after resolving symlinks in the parent path to close that gap.
632+
if err := checkSymlinkEscape(base, target); err != nil {
633+
return "", err
634+
}
628635
}
629636
if s.DisableOverwrite {
630637
if _, err := os.Stat(path); err == nil {
@@ -686,3 +693,52 @@ func (s *Store) setClosed() {
686693
func ensureDir(path string) error {
687694
return os.MkdirAll(path, 0777)
688695
}
696+
697+
// checkSymlinkEscape returns ErrPathTraversalDisallowed if resolving symlinks
698+
// in target's ancestor directories causes it to escape base. target may not
699+
// yet exist, so symlinks are resolved on its deepest existing ancestor.
700+
func checkSymlinkEscape(base, target string) error {
701+
realBase, err := filepath.EvalSymlinks(base)
702+
if err != nil {
703+
if os.IsNotExist(err) {
704+
return nil // base doesn't exist yet; no symlinks to follow
705+
}
706+
return err
707+
}
708+
realTarget, err := realPathForWrite(target)
709+
if err != nil {
710+
return err
711+
}
712+
rel, err := filepath.Rel(realBase, realTarget)
713+
if err != nil {
714+
return ErrPathTraversalDisallowed
715+
}
716+
rel = filepath.ToSlash(rel)
717+
if strings.HasPrefix(rel, "../") || rel == ".." {
718+
return ErrPathTraversalDisallowed
719+
}
720+
return nil
721+
}
722+
723+
// realPathForWrite resolves symlinks in the deepest existing ancestor of path
724+
// and returns the resulting absolute path. Non-existent path components are
725+
// appended verbatim, matching the semantics of a file about to be created.
726+
func realPathForWrite(path string) (string, error) {
727+
dir := filepath.Dir(path)
728+
suffix := filepath.Base(path)
729+
for {
730+
real, err := filepath.EvalSymlinks(dir)
731+
if err == nil {
732+
return filepath.Join(real, suffix), nil
733+
}
734+
if !os.IsNotExist(err) {
735+
return "", err
736+
}
737+
parent := filepath.Dir(dir)
738+
if parent == dir {
739+
return path, nil // reached filesystem root
740+
}
741+
suffix = filepath.Join(filepath.Base(dir), suffix)
742+
dir = parent
743+
}
744+
}

0 commit comments

Comments
 (0)