metrics: use rm -f to remove older continerd config file.

In order to run kata metrics we need to check that the containerd
config file is properly set. When this is not the case, we
need to remove that file, and generate a valid one.

This PR runs rm -f in order to ignore errors in case the
file to delete does not exist.

Fixes: #7336

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
David Esparza 2023-07-13 16:20:03 -06:00
parent 22d4e4c5a6
commit 3ae02f9202
No known key found for this signature in database
GPG Key ID: EABE0B1A98CC3B7A

View File

@ -257,7 +257,7 @@ function create_symbolic_links() {
# Configures containerd
function overwrite_containerd_config() {
containerd_config="/etc/containerd/config.toml"
sudo rm "${containerd_config}"
sudo rm -f "${containerd_config}"
sudo tee "${containerd_config}" << EOF
version = 2
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]