Description
When converting a system to RHEL using the convert2rhel utility, customers have a way to override certain pre-conversion analysis checks by setting CONVERT2RHEL_* environment variables. When executing a conversion through insights, convert2rhel is executed by python script that is executed by rhc-worker-script. In this case though convert2rhel doesn't have access to environment variables set on the host.
Test Instructions
- Register a CentOS Linux 7 host to Insights https://console.redhat.com/insights/
- Arrange the system so that the pre-conversion analysis hits a conversion inhibitor
mkdir /lib/modules/3.10.0-1160.102.1.el7.x86_64/kernel/drivers/net/bonding/custom mv /lib/modules/3.10.0-1160.102.1.el7.x86_64/kernel/drivers/net/bonding/bonding.ko.xz /lib/modules/3.10.0-1160.102.1.el7.x86_64/kernel/drivers/net/bonding/custom depmod modprobe bonding -v
- Run the Pre-conversion analysis Task in Insights https://console.redhat.com/insights/tasks/
- Set the CONVERT2RHEL_ALLOW_UNAVAILABLE_KMODS=1 enviroment variable on the host as suggested in the pre-conversion analysis report, e.g. by exporting it in ~/.bashrc in case the root user has /bin/bash as a default shell.
- Run the analysis Task again and see that the inhibitor is detected again/is not overriden.
Expected Results
convert2rhel is executed in a context that contains the environment variables set on the system. For that the expectation is that rhc should provide the context to rhc-worker-script.
Motivation / Justification
Customers are now ill-advised in the pre-conversion analysis report that they can override conversion inhibitors by setting an environment variable while in fact they can't.
Additional info
In the future we want to allow customers to override the inhibitors by ticking a checkbox in the Tasks UI. That's to be defined yet under HMS-2712.