Skip to content

Commit f79d88e

Browse files
committed
Update golang and containerd version
Update containerd version 1.6.36 Update golang version to 1.21.x Fix lint errors Signed-off-by: Kirtana Ashok <kiashok@microsoft.com>
1 parent 9196c84 commit f79d88e

File tree

14 files changed

+63
-35
lines changed

14 files changed

+63
-35
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- pull_request
55

66
env:
7-
GO_VERSION: "1.20.x"
7+
GO_VERSION: "1.21.x"
88
GOTESTSUM_VERSION: "latest"
99

1010
jobs:
@@ -38,9 +38,9 @@ jobs:
3838
# sometimes go cache causes issues with lint
3939
cache: false
4040

41-
- uses: golangci/golangci-lint-action@v3
41+
- uses: golangci/golangci-lint-action@v6
4242
with:
43-
version: v1.52
43+
version: v1.54
4444
args: >-
4545
--verbose
4646
--max-issues-per-linter=0

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- 'v*'
66

77
env:
8-
GO_VERSION: "1.18.x"
8+
GO_VERSION: "1.21.x"
99

1010
jobs:
1111
build:

cmd/containerd-shim-runhcs-v1/pod_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ func Test_pod_DeleteTask_TaskID_Not_Created(t *testing.T) {
391391
setupTestTaskInPod(t, p)
392392
setupTestTaskInPod(t, p)
393393

394-
seed := time.Now().UnixNano()
395-
source := rand.New(rand.NewSource(seed))
396-
397-
err := p.KillTask(context.Background(), strconv.Itoa((int)(source.Uint64())), "", 0xf, true)
394+
err := p.KillTask(context.Background(), strconv.Itoa(rand.Int()), "", 0xf, true)
398395
verifyExpectedError(t, nil, err, errdefs.ErrNotFound)
399396
}

cmd/containerd-shim-runhcs-v1/task_hcs_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ import (
1414

1515
func setupTestHcsTask(t *testing.T) (*hcsTask, *testShimExec, *testShimExec) {
1616
t.Helper()
17-
seed := time.Now().UnixNano()
18-
source := rand.New(rand.NewSource(seed))
1917

20-
initExec := newTestShimExec(t.Name(), t.Name(), int(source.Uint64()))
18+
initExec := newTestShimExec(t.Name(), t.Name(), int(rand.Int31()))
2119
lt := &hcsTask{
2220
events: newFakePublisher(),
2321
id: t.Name(),
2422
init: initExec,
2523
closed: make(chan struct{}),
2624
}
27-
secondExecID := strconv.FormatInt((int64)(source.Uint64()), 10)
28-
secondExec := newTestShimExec(t.Name(), secondExecID, int(source.Int31()))
25+
secondExecID := strconv.Itoa(rand.Int())
26+
secondExec := newTestShimExec(t.Name(), secondExecID, int(rand.Int31()))
2927
lt.execs.Store(secondExecID, secondExec)
3028
return lt, initExec, secondExec
3129
}

ext4/tar2ext4/tar2ext4.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func ConvertTarToExt4(r io.Reader, w io.ReadWriteSeeker, options ...Option) erro
148148

149149
var typ uint16
150150
switch hdr.Typeflag {
151-
case tar.TypeReg, tar.TypeRegA:
151+
case tar.TypeReg:
152152
typ = compactext4.S_IFREG
153153
case tar.TypeSymlink:
154154
typ = compactext4.S_IFLNK

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/cenkalti/backoff/v4 v4.2.0
99
github.com/containerd/cgroups v1.1.0
1010
github.com/containerd/console v1.0.3
11-
github.com/containerd/containerd v1.6.33
11+
github.com/containerd/containerd v1.6.36
1212
github.com/containerd/errdefs v0.1.0
1313
github.com/containerd/go-runc v1.0.0
1414
github.com/containerd/ttrpc v1.1.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0
215215
github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s=
216216
github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE=
217217
github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0=
218-
github.com/containerd/containerd v1.6.33 h1:8FYSFoV3UbizMgX7IKcP0GGAFw4+V3VPLo/CiU765WU=
219-
github.com/containerd/containerd v1.6.33/go.mod h1:Om5z+jDo6b8RkAxWf0ukj9JrPS/RYdhXNPwkZuuIyMk=
218+
github.com/containerd/containerd v1.6.36 h1:Bcj0ZXqgIs6GG+YbaKkMX3Dap0JsIVG4UYFOLRo7iX4=
219+
github.com/containerd/containerd v1.6.36/go.mod h1:gSufNaPbqri6ifEQ3eihFSXoGwqTENkqB7j//aEgE0s=
220220
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
221221
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
222222
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=

internal/cmd/io_npipe.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"context"
77
"fmt"
88
"io"
9-
"math/rand"
109
"net"
1110
"sync"
1211
"syscall"
@@ -20,11 +19,6 @@ import (
2019
"golang.org/x/sys/windows"
2120
)
2221

23-
func init() {
24-
// Need to seed for the rng in backoff.NextBackoff()
25-
rand.Seed(time.Now().UnixNano())
26-
}
27-
2822
// NewNpipeIO creates connected upstream io. It is the callers responsibility to validate that `if terminal == true`, `stderr == ""`. retryTimeout
2923
// refers to the timeout used to try and reconnect to the server end of the named pipe if the connection is severed. A value of 0 for retryTimeout
3024
// is treated as an infinite timeout.

internal/winapi/utils.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package winapi
44

55
import (
66
"errors"
7-
"reflect"
87
"syscall"
98
"unsafe"
109

@@ -14,11 +13,7 @@ import (
1413
// Uint16BufferToSlice wraps a uint16 pointer-and-length into a slice
1514
// for easier interop with Go APIs
1615
func Uint16BufferToSlice(buffer *uint16, bufferLength int) (result []uint16) {
17-
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&result))
18-
hdr.Data = uintptr(unsafe.Pointer(buffer))
19-
hdr.Cap = bufferLength
20-
hdr.Len = bufferLength
21-
16+
result = unsafe.Slice(buffer, bufferLength)
2217
return
2318
}
2419

test/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/Microsoft/go-winio v0.6.2
77
github.com/Microsoft/hcsshim v0.10.0-rc.3
88
github.com/containerd/cgroups v1.1.0
9-
github.com/containerd/containerd v1.6.33
9+
github.com/containerd/containerd v1.6.36
1010
github.com/containerd/errdefs v0.1.0
1111
github.com/containerd/go-runc v1.0.0
1212
github.com/containerd/log v0.1.0

0 commit comments

Comments
 (0)