Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
kata-deploy: Check crio conf before update
Browse files Browse the repository at this point in the history
kata-deploy inserts 'manage_network_ns_lifecycle' into crio.conf without any
prior checks and if there is a previous entry in the file, this becomes a
duplicate causing crio service restart issues. This patch addresses that
particular scenario.

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
  • Loading branch information
Ganesh Maharaj Mahalingam committed Feb 18, 2019
1 parent 2b382fd commit 059b48b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kata-deploy/scripts/kata-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ function configure_crio() {
runtime_path = "/opt/kata/bin/kata-fc"
EOT

sed -i 's|\(\[crio\.runtime\]\)|\1\nmanage_network_ns_lifecycle = true|' "$crio_conf_file"
# Replace if exists, insert otherwise
grep -Fq 'manage_network_ns_lifecycle =' $crio_conf_file \
&& sed -i '/manage_network_ns_lifecycle =/c manage_network_ns_lifecycle = true' $crio_conf_file \
|| sed -i '/\[crio.runtime\]/a manage_network_ns_lifecycle = true' $crio_conf_file
}

function configure_containerd() {
Expand Down

0 comments on commit 059b48b

Please sign in to comment.