Merge pull request #2822 from mtrmac/go1.25

Update to Go 1.25
This commit is contained in:
Paul Holzinger
2026-03-12 17:14:57 +01:00
committed by GitHub
4 changed files with 12 additions and 23 deletions

View File

@@ -332,7 +332,6 @@ func (h *proxyHandler) allocPipe() (*os.File, *activePipe, error) {
w: pipew,
}
h.activePipes[uint32(pipew.Fd())] = &f
f.wg.Add(1)
return piper, &f, nil
}
@@ -345,14 +344,12 @@ func (h *proxyHandler) returnBytes(retval any, buf []byte) (replyBuf, error) {
return ret, err
}
go func() {
// Signal completion when we return
defer f.wg.Done()
f.wg.Go(func() {
_, err = io.Copy(f.w, bytes.NewReader(buf))
if err != nil {
f.err = err
}
}()
})
ret.value = retval
ret.fd = piper
@@ -583,10 +580,8 @@ func (h *proxyHandler) GetBlob(args []any) (replyBuf, error) {
blobr.Close()
return ret, err
}
go func() {
// Signal completion when we return
f.wg.Go(func() {
defer blobr.Close()
defer f.wg.Done()
verifier := d.Verifier()
tr := io.TeeReader(blobr, verifier)
n, err := io.Copy(f.w, tr)
@@ -600,7 +595,7 @@ func (h *proxyHandler) GetBlob(args []any) (replyBuf, error) {
if !verifier.Verified() {
f.err = fmt.Errorf("corrupted blob, expecting %s", d.String())
}
}()
})
ret.value = blobSize
ret.fd = piper

4
go.mod
View File

@@ -1,9 +1,7 @@
module github.com/containers/skopeo
// Minimum required golang version
go 1.24.6
toolchain go1.24.10
go 1.25.0
// Warning: Ensure the "go" and "toolchain" versions match exactly to prevent unwanted auto-updates

View File

@@ -214,9 +214,7 @@ func (p *proxy) callGetRawBlob(args []any) (rval any, buf []byte, err error) {
var wg sync.WaitGroup
fetchchan := make(chan byteFetch, 1)
errchan := make(chan proxyError, 1)
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
defer close(fetchchan)
defer fd.datafd.Close()
buf, err := io.ReadAll(fd.datafd)
@@ -224,10 +222,8 @@ func (p *proxy) callGetRawBlob(args []any) (rval any, buf []byte, err error) {
content: buf,
err: err,
}
}()
wg.Add(1)
go func() {
defer wg.Done()
})
wg.Go(func() {
defer fd.errfd.Close()
defer close(errchan)
buf, err := io.ReadAll(fd.errfd)
@@ -248,7 +244,7 @@ func (p *proxy) callGetRawBlob(args []any) (rval any, buf []byte, err error) {
panic(unmarshalErr)
}
errchan <- proxyErr
}()
})
wg.Wait()
errMsg := <-errchan
@@ -388,7 +384,7 @@ func runTestMetadataAPIs(p *proxy, img string) error {
if err != nil {
return err
}
var layerInfoBytesData []interface{}
var layerInfoBytesData []any
err = json.Unmarshal(layerInfoBytes, &layerInfoBytesData)
if err != nil {
return err

View File

@@ -243,7 +243,7 @@ func (s *tlsSuite) TestOpenShift() {
t.Setenv("KUBECONFIG", configPath)
for _, e := range s.expected {
err := os.WriteFile(configPath, []byte(fmt.Sprintf(
err := os.WriteFile(configPath, fmt.Appendf(nil,
`apiVersion: v1
clusters:
- cluster:
@@ -257,7 +257,7 @@ contexts:
name: our-context
current-context: our-context
kind: Config
`, e.server.certPath, e.server.server.URL)), 0o644)
`, e.server.certPath, e.server.server.URL), 0o644)
require.NoError(t, err)
// The atomic: image access starts with resolving the tag in a k8s API (and that will always fail, one way or another),
// so we never actually contact registry.example.