Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Remove 10-containerd-net.conflist from cri-containerd-cni release t…
Browse files Browse the repository at this point in the history
…arball.

Signed-off-by: Lantao Liu <[email protected]>
  • Loading branch information
Random-Liu committed Apr 18, 2018
1 parent b2ebb73 commit 72ade6c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 30 deletions.
49 changes: 49 additions & 0 deletions hack/install/install-cni-config.sh
Original file line number Diff line number Diff line change
@@ -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'
28 changes: 0 additions & 28 deletions hack/install/install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}
8 changes: 8 additions & 0 deletions hack/install/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
3 changes: 2 additions & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion hack/test-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 72ade6c

Please sign in to comment.