Merge pull request #392 from Random-Liu/add-crictl-config
Add crictl config.
This commit is contained in:
commit
4a4a860dfa
@ -54,6 +54,7 @@ CONTAINERD_DIR=${DESTDIR}/usr/local
|
||||
RUNC_DIR=${DESTDIR}
|
||||
CNI_DIR=${DESTDIR}/opt/cni
|
||||
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
|
||||
CRICTL_CONFIG_DIR=${DESTDIR}/etc
|
||||
|
||||
RUNC_PKG=github.com/opencontainers/runc
|
||||
CNI_PKG=github.com/containernetworking/plugins
|
||||
@ -138,3 +139,7 @@ ${sudo} make install -e DESTDIR=${CONTAINERD_DIR}
|
||||
checkout_repo ${CRITOOL_PKG} ${CRITOOL_VERSION}
|
||||
cd ${GOPATH}/src/${CRITOOL_PKG}
|
||||
make
|
||||
${sudo} mkdir -p ${CRICTL_CONFIG_DIR}
|
||||
${sudo} bash -c 'cat >'${CRICTL_CONFIG_DIR}'/crictl.yaml <<EOF
|
||||
runtime-endpoint: /var/run/cri-containerd.sock
|
||||
EOF'
|
||||
|
@ -28,14 +28,7 @@ import (
|
||||
)
|
||||
|
||||
// Attach prepares a streaming endpoint to attach to a running container, and returns the address.
|
||||
func (c *criContainerdService) Attach(ctx context.Context, r *runtime.AttachRequest) (retRes *runtime.AttachResponse, retErr error) {
|
||||
glog.V(2).Infof("Attach for %q with tty %v and stdin %v", r.GetContainerId(), r.GetTty(), r.GetStdin())
|
||||
defer func() {
|
||||
if retErr == nil {
|
||||
glog.V(2).Infof("Attach for %q returns URL %q", r.GetContainerId(), retRes.Url)
|
||||
}
|
||||
}()
|
||||
|
||||
func (c *criContainerdService) Attach(ctx context.Context, r *runtime.AttachRequest) (*runtime.AttachResponse, error) {
|
||||
cntr, err := c.containerStore.Get(r.GetContainerId())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find container in store: %v", err)
|
||||
|
@ -69,6 +69,9 @@ TARBALL="cri-containerd.tar.gz"
|
||||
curl -f --ipv4 -Lo "${TARBALL}" --connect-timeout 20 --max-time 300 --retry 6 --retry-delay 10 "${TARBALL_GCS_PATH}"
|
||||
tar xvf "${TARBALL}"
|
||||
|
||||
# Copy crictl config.
|
||||
cp "${CRI_CONTAINERD_HOME}/etc/crictl.yaml" /etc
|
||||
|
||||
# TODO(random-liu): Stop docker on the node, this may break docker.
|
||||
echo "export PATH=${CRI_CONTAINERD_HOME}/usr/local/bin/:${CRI_CONTAINERD_HOME}/usr/local/sbin/:\$PATH" > \
|
||||
/etc/profile.d/cri-containerd_env.sh
|
||||
|
Loading…
Reference in New Issue
Block a user