confidential-containers / cloud-api-adaptor

Ability to create Kata pods using cloud provider APIs aka the peer-pods approach
Apache License 2.0
44 stars 71 forks source link

libvirt: Fix config_libvirt to not exit #1826

Closed stevenhorsman closed 2 months ago

stevenhorsman commented 2 months ago

https://github.com/confidential-containers/cloud-api-adaptor/pull/1822 broke the e2e libvirt tests jobs (https://github.com/confidential-containers/cloud-api-adaptor/actions/runs/8873277040/job/24359701508). We should have added the test_e2e_libvirt label, so sorry for missing that during the review.

config_libvirt.sh has set -o errexit, so we can't use a grep for rhel and test if it fails as this will exit the script. Instead use the ID field from /etc/os-release or /usr/lib/os-release

huoqifeng commented 2 months ago

Tried it on ubuntu, looks good to me. Thanks @stevenhorsman figure out the problem!

# source /etc/os-release
# echo $ID
ubuntu
wainersm commented 2 months ago

/etc/os-release

And in fedora:

$ echo $(source /etc/os-release; echo $ID)
fedora

Many scripts in kata will look for two locations like source /etc/os-release || source /usr/lib/os-release. Apparently some distributions rely on /usr/lib/os-release only. Anyway, I don't think we should be paranoid here, saying just in case it rings any bell.