Skip to content

Commit 883daaa

Browse files
authored
Merge pull request #704 from kzys/ctrd-168
Upgrade containerd from 1.6.6 to 1.6.8
2 parents 91cbf8c + 9ffd621 commit 883daaa

File tree

22 files changed

+51
-71
lines changed

22 files changed

+51
-71
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: ['ubuntu-20.04', 'ubuntu-22.04']
17-
go: ['1.16', '1.17']
17+
go: ['1.17', '1.18', '1.19']
1818
# Build all variants regardless of failures
1919
fail-fast: false
2020

@@ -49,13 +49,6 @@ jobs:
4949
- run: |
5050
make tidy
5151
git diff --exit-code
52-
# opencontainers/selinux uses Go 1.16's io/fs package with "go1.16"
53-
# build tag. However, since go mod tidy acts as like all build tags
54-
# are enabled, the file below included in go mod tidy, even
55-
# Go is < 1.16.
56-
# https://github.com/opencontainers/selinux/blob/v1.9.1/go-selinux/rchcon.go
57-
# https://golang.org/ref/mod
58-
if: matrix.go >= '1.16'
5952
- run: |
6053
make proto
6154
git diff --exit-code

agent/drive_handler.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package main
1616
import (
1717
"context"
1818
"fmt"
19-
"io/ioutil"
2019
"os"
2120
"path/filepath"
2221
"strings"
@@ -124,7 +123,7 @@ func (d drive) Path() string {
124123

125124
func getListOfBlockDeviceNames(path string) ([]string, error) {
126125
names := []string{}
127-
infos, err := ioutil.ReadDir(path)
126+
infos, err := os.ReadDir(path)
128127
if err != nil {
129128
return nil, err
130129
}
@@ -144,7 +143,7 @@ func (dh driveHandler) buildDrive(name string) (drive, error) {
144143
DrivePath: dh.DrivePath,
145144
}
146145

147-
majorMinorStr, err := ioutil.ReadFile(filepath.Join(dh.BlockPath, name, blockMajorMinor))
146+
majorMinorStr, err := os.ReadFile(filepath.Join(dh.BlockPath, name, blockMajorMinor))
148147
if err != nil {
149148
return d, err
150149
}

config/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package config
1616
import (
1717
"encoding/json"
1818
"fmt"
19-
"io/ioutil"
2019
"os"
2120

2221
"github.com/firecracker-microvm/firecracker-containerd/internal"
@@ -78,7 +77,7 @@ func LoadConfig(path string) (*Config, error) {
7877
path = defaultConfigPath
7978
}
8079

81-
data, err := ioutil.ReadFile(path)
80+
data, err := os.ReadFile(path)
8281
if err != nil {
8382
return nil, fmt.Errorf("failed to read config from %q: %w", path, err)
8483
}

config/config_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package config
1515

1616
import (
1717
"fmt"
18-
"io/ioutil"
1918
"os"
2019
"testing"
2120

@@ -63,11 +62,11 @@ func TestLoadConfigOverrides(t *testing.T) {
6362

6463
func createTempConfig(t *testing.T, contents string) (string, func()) {
6564
t.Helper()
66-
configFile, err := ioutil.TempFile("", "config")
65+
configFile, err := os.CreateTemp("", "config")
6766
if err != nil {
6867
t.Fatal(err, "failed to create temp config file")
6968
}
70-
err = ioutil.WriteFile(configFile.Name(), []byte(contents), 0644)
69+
err = os.WriteFile(configFile.Name(), []byte(contents), 0644)
7170
if err != nil {
7271
os.Remove(configFile.Name())
7372
t.Fatal(err, "failed to write contents to temp config file")

docker-credential-mmds/mmds/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"encoding/json"
1717
"errors"
1818
"fmt"
19-
"io/ioutil"
19+
"io"
2020
"net/http"
2121
"net/url"
2222
"strings"
@@ -83,7 +83,7 @@ func (c *Client) refreshToken() error {
8383
c.version = v1
8484
return nil
8585
}
86-
token, err := ioutil.ReadAll(resp.Body)
86+
token, err := io.ReadAll(resp.Body)
8787
if err != nil {
8888
return err
8989
}
@@ -131,11 +131,11 @@ func (c *Client) getMetadata(path string) ([]byte, error) {
131131
func readBody(resp *http.Response) ([]byte, error) {
132132
switch status := resp.StatusCode; {
133133
case status < 300:
134-
return ioutil.ReadAll(resp.Body)
134+
return io.ReadAll(resp.Body)
135135
case status == http.StatusUnauthorized:
136136
return []byte{}, errUnauthorized
137137
default:
138-
body, err := ioutil.ReadAll(resp.Body)
138+
body, err := io.ReadAll(resp.Body)
139139
return []byte{}, fmt.Errorf("unexpected http response: %d - (err %v) %s", status, err, string(body))
140140
}
141141
}

docker-credential-mmds/mmds/client_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"errors"
1818
"fmt"
1919
"io"
20-
"io/ioutil"
2120
"net/http"
2221
"testing"
2322

@@ -46,7 +45,7 @@ func v1TokenResponse() (*http.Response, error) {
4645
func v2TokenResponse() (*http.Response, error) {
4746
return &http.Response{
4847
StatusCode: http.StatusOK,
49-
Body: ioutil.NopCloser(bytes.NewBufferString(token)),
48+
Body: io.NopCloser(bytes.NewBufferString(token)),
5049
}, nil
5150
}
5251

docker-credential-mmds/mmds/helper_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package mmds
1616
import (
1717
"bytes"
1818
"fmt"
19-
"io/ioutil"
19+
"io"
2020
"net/http"
2121
"testing"
2222

@@ -63,14 +63,14 @@ const (
6363
func validMetadataResponse() (*http.Response, error) {
6464
return &http.Response{
6565
StatusCode: http.StatusOK,
66-
Body: ioutil.NopCloser(bytes.NewBufferString(validDockerCredentials)),
66+
Body: io.NopCloser(bytes.NewBufferString(validDockerCredentials)),
6767
}, nil
6868
}
6969

7070
func metadataResponse() (*http.Response, error) {
7171
return &http.Response{
7272
StatusCode: http.StatusOK,
73-
Body: ioutil.NopCloser(bytes.NewBufferString(dockerCredentials)),
73+
Body: io.NopCloser(bytes.NewBufferString(dockerCredentials)),
7474
}, nil
7575
}
7676

examples/cmd/remote-snapshotter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/firecracker-microvm/firecracker-containerd/example/remote-snap
33
go 1.16
44

55
require (
6-
github.com/containerd/containerd v1.6.6
6+
github.com/containerd/containerd v1.6.8
77
github.com/containerd/stargz-snapshotter v0.11.3
88
github.com/firecracker-microvm/firecracker-containerd v0.0.0-20220430002346-5f6efb9fdce8
99
)

examples/cmd/remote-snapshotter/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwT
8181
github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4=
8282
github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg=
8383
github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc=
84-
github.com/Microsoft/hcsshim v0.9.3 h1:k371PzBuRrz2b+ebGuI2nVgVhgsVX60jMfSw80NECxo=
85-
github.com/Microsoft/hcsshim v0.9.3/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc=
84+
github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I=
85+
github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc=
8686
github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU=
8787
github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY=
8888
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
@@ -203,8 +203,8 @@ github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTV
203203
github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c=
204204
github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s=
205205
github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE=
206-
github.com/containerd/containerd v1.6.6 h1:xJNPhbrmz8xAMDNoVjHy9YHtWwEQNS+CDkcIRh7t8Y0=
207-
github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0=
206+
github.com/containerd/containerd v1.6.8 h1:h4dOFDwzHmqFEP754PgfgTeVXFnLiRc6kiqC7tplDJs=
207+
github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0=
208208
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
209209
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
210210
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=

examples/taskworkflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"context"
1818
"flag"
1919
"fmt"
20-
"io/ioutil"
20+
"io"
2121
"log"
2222
"net"
2323
"net/http"
@@ -197,7 +197,7 @@ func getResponse(containerIP string) error {
197197
}
198198
defer response.Body.Close()
199199

200-
contents, err := ioutil.ReadAll(response.Body)
200+
contents, err := io.ReadAll(response.Body)
201201
if err != nil {
202202
return fmt.Errorf("Unable to read response body from %s: %w", containerIP, err)
203203
}

0 commit comments

Comments
 (0)