Remove 10-containerd-net.conflist from cri-containerd-cni release tarball.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2018-04-17 17:38:55 -07:00
parent b2ebb735e7
commit 72ade6c4f5
5 changed files with 60 additions and 30 deletions

View File

@ -0,0 +1,49 @@
#!/bin/bash
# Copyright 2018 The containerd Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
source $(dirname "${BASH_SOURCE[0]}")/utils.sh
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
${SUDO} mkdir -p ${CNI_CONFIG_DIR}
${SUDO} bash -c 'cat >'${CNI_CONFIG_DIR}'/10-containerd-net.conflist <<EOF
{
"cniVersion": "0.3.1",
"name": "containerd-net",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"promiscMode": true,
"ipam": {
"type": "host-local",
"subnet": "10.88.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
},
{
"type": "portmap",
"capabilities": {"portMappings": true}
}
]
}
EOF'

View File

@ -20,7 +20,6 @@ set -o pipefail
source $(dirname "${BASH_SOURCE[0]}")/utils.sh
CNI_DIR=${DESTDIR}/opt/cni
CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
CNI_PKG=github.com/containernetworking/plugins
# Create a temporary GOPATH for cni installation.
@ -34,33 +33,6 @@ cd ${GOPATH}/src/${CNI_PKG}
FASTBUILD=true ./build.sh
${SUDO} mkdir -p ${CNI_DIR}
${SUDO} cp -r ./bin ${CNI_DIR}
${SUDO} mkdir -p ${CNI_CONFIG_DIR}
${SUDO} bash -c 'cat >'${CNI_CONFIG_DIR}'/10-containerd-net.conflist <<EOF
{
"cniVersion": "0.3.1",
"name": "containerd-net",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"promiscMode": true,
"ipam": {
"type": "host-local",
"subnet": "10.88.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
},
{
"type": "portmap",
"capabilities": {"portMappings": true}
}
]
}
EOF'
# Clean the tmp GOPATH dir.
rm -rf ${TMPGOPATH}

View File

@ -34,6 +34,9 @@ cd $(dirname "${BASH_SOURCE[0]}")
# and configurations in cluster.
INSTALL_CNI=${INSTALL_CNI:-true}
# INSTALL_CNI indicates whether to install CNI config.
INSTALL_CNI_CONFIG=${INSTALL_CNI_CONFIG:-true}
# Install runc
./install-runc.sh
@ -42,6 +45,11 @@ if ${INSTALL_CNI}; then
./install-cni.sh
fi
# Install cni config
if ${INSTALL_CNI_CONFIG}; then
./install-cni-config.sh
fi
# Install containerd
./install-containerd.sh

View File

@ -43,7 +43,8 @@ fi
rm -rf ${destdir}
# Install dependencies into release stage.
NOSUDO=true INSTALL_CNI=${INCLUDE_CNI} DESTDIR=${destdir} ./hack/install/install-deps.sh
NOSUDO=true INSTALL_CNI=${INCLUDE_CNI} INSTALL_CNI_CONFIG=false DESTDIR=${destdir} \
./hack/install/install-deps.sh
if ${CUSTOM_CONTAINERD}; then
make install -e DESTDIR=${destdir}

View File

@ -40,7 +40,7 @@ test_setup() {
exit 1
fi
sudo pkill -x containerd
keepalive "sudo ${ROOT}/_output/containerd ${CONTAINERD_FLAGS}" \
keepalive "sudo PATH=${PATH} ${ROOT}/_output/containerd ${CONTAINERD_FLAGS}" \
${RESTART_WAIT_PERIOD} &> ${report_dir}/containerd.log &
containerd_pid=$!
# Wait for containerd to be running by using the containerd client ctr to check the version