Skip to content

Commit 387da59

Browse files
committed
Rename all variables to remove "cricontainerd".
Signed-off-by: Lantao Liu <lantaol@google.com>
1 parent 9afdd19 commit 387da59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+156
-157
lines changed

cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var loadCommand = cli.Command{
4949
timeout = context.GlobalDuration("timeout")
5050
cancel gocontext.CancelFunc
5151
)
52-
cl, err := client.NewCRIContainerdClient(address, timeout)
52+
cl, err := client.NewCRIPluginClient(address, timeout)
5353
if err != nil {
5454
return errors.Wrap(err, "failed to create grpc client")
5555
}

cri.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func initCRIService(ic *plugin.InitContext) (interface{}, error) {
9292
return nil, errors.Wrap(err, "failed to create containerd client")
9393
}
9494

95-
s, err := server.NewCRIContainerdService(c, client)
95+
s, err := server.NewCRIService(c, client)
9696
if err != nil {
9797
return nil, errors.Wrap(err, "failed to create CRI service")
9898
}

hack/update-proto.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ protoc \
4141

4242
# Update boilerplate for the generated file.
4343
echo "$(cat hack/boilerplate/boilerplate.go.txt ${API_ROOT}/api.pb.go)" > ${API_ROOT}/api.pb.go
44-
sed -i".bak" "s/Copyright YEAR/Copyright $(date '+%Y')/g" ${API_ROOT}/api.pb.go
44+
sed -i".bak" "s/Copyright YEAR AUTHORS/Copyright $(date '+%Y') The containerd Authors/g" ${API_ROOT}/api.pb.go
4545

4646
gofmt -l -s -w ${API_ROOT}/api.pb.go

integration/image_load_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestImageLoad(t *testing.T) {
5858
}
5959

6060
t.Logf("load image in cri")
61-
res, err := criContainerdClient.LoadImage(context.Background(), &api.LoadImageRequest{FilePath: tar})
61+
res, err := criPluginClient.LoadImage(context.Background(), &api.LoadImageRequest{FilePath: tar})
6262
require.NoError(t, err)
6363
require.Equal(t, []string{loadedImage}, res.GetImages())
6464

integration/test_utils.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ const (
4545
)
4646

4747
var (
48-
runtimeService cri.RuntimeService
49-
imageService cri.ImageManagerService
50-
containerdClient *containerd.Client
51-
criContainerdClient api.CRIContainerdServiceClient
48+
runtimeService cri.RuntimeService
49+
imageService cri.ImageManagerService
50+
containerdClient *containerd.Client
51+
criPluginClient api.CRIPluginServiceClient
5252
)
5353

54-
var criContainerdEndpoint = flag.String("cri-endpoint", "/run/containerd/containerd.sock", "The endpoint of cri plugin.")
55-
var criContainerdRoot = flag.String("cri-root", "/var/lib/containerd/io.containerd.grpc.v1.cri", "The root directory of cri plugin.")
54+
var criEndpoint = flag.String("cri-endpoint", "/run/containerd/containerd.sock", "The endpoint of cri plugin.")
55+
var criRoot = flag.String("cri-root", "/var/lib/containerd/io.containerd.grpc.v1.cri", "The root directory of cri plugin.")
5656

5757
func init() {
5858
flag.Parse()
@@ -64,11 +64,11 @@ func init() {
6464
// ConnectDaemons connect cri plugin and containerd, and initialize the clients.
6565
func ConnectDaemons() error {
6666
var err error
67-
runtimeService, err = remote.NewRemoteRuntimeService(*criContainerdEndpoint, timeout)
67+
runtimeService, err = remote.NewRemoteRuntimeService(*criEndpoint, timeout)
6868
if err != nil {
6969
return errors.Wrap(err, "failed to create runtime service")
7070
}
71-
imageService, err = remote.NewRemoteImageService(*criContainerdEndpoint, timeout)
71+
imageService, err = remote.NewRemoteImageService(*criEndpoint, timeout)
7272
if err != nil {
7373
return errors.Wrap(err, "failed to create image service")
7474
}
@@ -87,7 +87,7 @@ func ConnectDaemons() error {
8787
if err != nil {
8888
return errors.Wrap(err, "failed to connect containerd")
8989
}
90-
criContainerdClient, err = client.NewCRIContainerdClient(*criContainerdEndpoint, timeout)
90+
criPluginClient, err = client.NewCRIPluginClient(*criEndpoint, timeout)
9191
if err != nil {
9292
return errors.Wrap(err, "failed to connect cri plugin")
9393
}

integration/volume_copy_up_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestVolumeCopyUp(t *testing.T) {
7070
assert.Equal(t, "test_content\n", string(stdout))
7171

7272
t.Logf("Check host path of the volume")
73-
hostCmd := fmt.Sprintf("ls %s/containers/%s/volumes/*/test_file | xargs cat", *criContainerdRoot, cn)
73+
hostCmd := fmt.Sprintf("ls %s/containers/%s/volumes/*/test_file | xargs cat", *criRoot, cn)
7474
output, err := exec.Command("sh", "-c", hostCmd).CombinedOutput()
7575
require.NoError(t, err)
7676
assert.Equal(t, "test_content\n", string(output))

pkg/api/v1/api.pb.go

Lines changed: 28 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/v1/api.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ option (gogoproto.sizer_all) = true;
1313
option (gogoproto.unmarshaler_all) = true;
1414
option (gogoproto.goproto_unrecognized_all) = false;
1515

16-
// CRIContainerdService defines non-CRI APIs for cri-containerd.
17-
service CRIContainerdService{
16+
// CRIPluginService defines non-CRI APIs for cri plugin.
17+
service CRIPluginService{
1818
// LoadImage loads a image into containerd.
1919
rpc LoadImage(LoadImageRequest) returns (LoadImageResponse) {}
2020
}

pkg/client/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
api "github.com/containerd/cri/pkg/api/v1"
2727
)
2828

29-
// NewCRIContainerdClient creates grpc client of cri-containerd
29+
// NewCRIPluginClient creates grpc client of cri plugin
3030
// TODO(random-liu): Wrap grpc functions.
31-
func NewCRIContainerdClient(endpoint string, timeout time.Duration) (api.CRIContainerdServiceClient, error) {
31+
func NewCRIPluginClient(endpoint string, timeout time.Duration) (api.CRIPluginServiceClient, error) {
3232
addr, dialer, err := util.GetAddressAndDialer(endpoint)
3333
if err != nil {
3434
return nil, errors.Wrap(err, "failed to get dialer")
@@ -43,5 +43,5 @@ func NewCRIContainerdClient(endpoint string, timeout time.Duration) (api.CRICont
4343
if err != nil {
4444
return nil, errors.Wrap(err, "failed to dial")
4545
}
46-
return api.NewCRIContainerdServiceClient(conn), nil
46+
return api.NewCRIPluginServiceClient(conn), nil
4747
}

pkg/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type Config struct {
8888
ContainerdRootDir string `json:"containerdRootDir,omitempty"`
8989
// ContainerdEndpoint is the containerd endpoint path.
9090
ContainerdEndpoint string `json:"containerdEndpoint,omitempty"`
91-
// RootDir is the root directory path for managing cri-containerd files
91+
// RootDir is the root directory path for managing cri plugin files
9292
// (metadata checkpoint etc.)
9393
RootDir string `json:"rootDir,omitempty"`
9494
}

0 commit comments

Comments
 (0)