diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-13 16:10:58 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-13 16:10:58 -0700 |
commit | c81ac8ec3b78f898e75830a93b5ed3085b785fd6 (patch) | |
tree | 03042d0bb4b544533d08da6625069d3e6c10d657 /tools/installers/shim.sh | |
parent | 59a5479409094b141a60cfcc65f0a53d7871e2e1 (diff) | |
parent | 2afff44403e046078301de39f0252bb57fc018c7 (diff) |
Merge pull request #2672 from amscanne:shim-integrated
PiperOrigin-RevId: 321053634
Diffstat (limited to 'tools/installers/shim.sh')
-rwxr-xr-x | tools/installers/shim.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tools/installers/shim.sh b/tools/installers/shim.sh index f7dd790a1..8153ce283 100755 --- a/tools/installers/shim.sh +++ b/tools/installers/shim.sh @@ -14,11 +14,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Reinstall the latest containerd shim. -declare -r base="https://storage.googleapis.com/cri-containerd-staging/gvisor-containerd-shim" -declare -r latest=$(mktemp --tmpdir gvisor-containerd-shim-latest.XXXXXX) -declare -r shim_path=$(mktemp --tmpdir gvisor-containerd-shim.XXXXXX) -wget --no-verbose "${base}"/latest -O ${latest} -wget --no-verbose "${base}"/gvisor-containerd-shim-$(cat ${latest}) -O ${shim_path} -chmod +x ${shim_path} -mv ${shim_path} /usr/local/bin/gvisor-containerd-shim +# Install all the shims. +# +# Note that containerd looks at the current executable directory +# in order to find the shim binary. So we need to check in order +# of preference. The local containerd installer will install to +# /usr/local, so we use that first. +if [[ -x /usr/local/bin/containerd ]]; then + containerd_install_dir=/usr/local/bin +else + containerd_install_dir=/usr/bin +fi +runfiles=. +if [[ -d "$0.runfiles" ]]; then + runfiles="$0.runfiles" +fi +find -L "${runfiles}" -executable -type f -name containerd-shim-runsc-v1 -exec cp -L {} "${containerd_install_dir}" \; +find -L "${runfiles}" -executable -type f -name gvisor-containerd-shim -exec cp -L {} "${containerd_install_dir}" \; |