Skip to content

Commit a9cb223

Browse files
committed
Copy pkg/symlink and pkg/truncindex from moby/moby
moby/moby SHA : 9c15e82f19b0ad3c5fe8617a8ec2dddc6639f40a github.com/docker/docker/pkg/truncindex/truncindex.go -> pkg/cri/store/truncindex/truncindex.go github.com/docker/docker/pkg/symlink/LICENSE.APACHE -> pkg/symlink/LICENSE.APACHE github.com/docker/docker/pkg/symlink/LICENSE.BSD -> pkg/symlink/LICENSE.BSD github.com/docker/docker/pkg/symlink/README.md -> pkg/symlink/README.md github.com/docker/docker/pkg/symlink/fs.go -> pkg/symlink/fs.go github.com/docker/docker/pkg/symlink/fs_unix.go -> pkg/symlink/fs_unix.go github.com/docker/docker/pkg/symlink/fs_windows.go -> pkg/symlink/fs_windows.go Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 22aea1e commit a9cb223

28 files changed

Lines changed: 95 additions & 717 deletions

File tree

pkg/cri/store/container/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/containerd/containerd"
2323
"github.com/containerd/containerd/pkg/cri/store/label"
24-
"github.com/docker/docker/pkg/truncindex"
24+
"github.com/containerd/containerd/pkg/cri/store/truncindex"
2525
runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
2626

2727
cio "github.com/containerd/containerd/pkg/cri/io"

pkg/cri/store/sandbox/sandbox.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/containerd/containerd"
2323
"github.com/containerd/containerd/pkg/cri/store/label"
24-
"github.com/docker/docker/pkg/truncindex"
24+
"github.com/containerd/containerd/pkg/cri/store/truncindex"
2525

2626
"github.com/containerd/containerd/pkg/cri/store"
2727
"github.com/containerd/containerd/pkg/netns"

vendor/github.com/docker/docker/pkg/truncindex/truncindex.go renamed to pkg/cri/store/truncindex/truncindex.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// This file is a copy of moby/moby/pkg/truncindex/truncindex.go
18+
119
// Package truncindex provides a general 'index tree', used by Docker
220
// in order to be able to reference containers by only a few unambiguous
321
// characters of their id.
4-
package truncindex // import "github.com/docker/docker/pkg/truncindex"
22+
package truncindex
523

624
import (
725
"errors"

pkg/netns/netns_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ import (
4040
"sync"
4141

4242
"github.com/containerd/containerd/mount"
43+
"github.com/containerd/containerd/pkg/symlink"
4344
cnins "github.com/containernetworking/plugins/pkg/ns"
44-
"github.com/docker/docker/pkg/symlink"
4545
"github.com/pkg/errors"
4646
"golang.org/x/sys/unix"
4747
)

pkg/os/os.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"os"
2323
"path/filepath"
2424

25-
"github.com/docker/docker/pkg/symlink"
25+
"github.com/containerd/containerd/pkg/symlink"
2626
)
2727

2828
// OS collects system level operations that need to be mocked out

vendor/github.com/docker/docker/pkg/symlink/LICENSE.APACHE renamed to pkg/symlink/LICENSE.APACHE

File renamed without changes.

vendor/github.com/docker/docker/pkg/symlink/LICENSE.BSD renamed to pkg/symlink/LICENSE.BSD

File renamed without changes.

vendor/github.com/docker/docker/pkg/symlink/README.md renamed to pkg/symlink/README.md

File renamed without changes.

vendor/github.com/docker/docker/pkg/symlink/fs.go renamed to pkg/symlink/fs.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
/*
2+
Copyright The containerd Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
// Copyright 2012 The Go Authors. All rights reserved.
218
// Use of this source code is governed by a BSD-style
319
// license that can be found in the LICENSE.BSD file.
420

521
// This code is a modified version of path/filepath/symlink.go from the Go standard library.
22+
// This file is a copy of moby/moby/pkg/symlink/fs.go
623

7-
package symlink // import "github.com/docker/docker/pkg/symlink"
24+
package symlink
825

926
import (
1027
"bytes"

pkg/symlink/fs_unix.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// +build !windows
2+
3+
/*
4+
Copyright The containerd Authors.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
// This file is a copy of moby/moby/pkg/symlink/fs_unix.go
20+
21+
package symlink
22+
23+
import (
24+
"path/filepath"
25+
)
26+
27+
func evalSymlinks(path string) (string, error) {
28+
return filepath.EvalSymlinks(path)
29+
}
30+
31+
func isDriveOrRoot(p string) bool {
32+
return p == string(filepath.Separator)
33+
}
34+
35+
var isAbs = filepath.IsAbs

0 commit comments

Comments
 (0)