cm: handle nil cpumanager avoiding segfault
cm: handle nil cpumanager avoiding segfault

If the cpumanager feature gate is disabled, the corresponsing field
of the containerManager will be nil.
A couple functions don't check for this occurrence and happily
deference the pointer unconditionally, leading to possible segfaults.

The relevant functions were introduced to support the podresources API,
so to trigger this segfault all the following are needed:
- cpumanager feature gate has to be disabled explicitely
- any podresources API must be called

Worth pointing out that when the new functions were introduced (around
kubernetes 1.20) the default feature gate for cpumanager was already set
to true, hence this bug is expected to be triggered rarely.

Signed-off-by: Francesco Romani <c7100b580e6017ef67482ace46578cdd2d2e0dfe@redhat.com>

openshift/kubernetes,dixudx/kubernetes,mengqiy/kubernetes,liggitt/kubernetes,micahhausler/kubernetes,carlory/kubernetes,jessfraz/kubernetes,krmayankk/kubernetes,mengqiy/kubernetes,mahak/kubernetes,micahhausler/kubernetes,feiskyer/kubernetes,bparees/kubernetes,kubernetes/kubernetes,li-ang/kubernetes,kevin-wangzefeng/kubernetes,k82cn/kubernetes,carlory/kubernetes,zhangmingld/kubernetes,Acidburn0zzz/kubernetes,bparees/kubernetes,bparees/kubernetes,humblec/kubernetes,mahak/kubernetes,PI-Victor/kubernetes,olivierlemasle/kubernetes,rafax/kubernetes,dims/kubernetes,openshift/kubernetes,shyamjvs/kubernetes,dereknex/kubernetes,li-ang/kubernetes,spzala/kubernetes,thockin/kubernetes,chrislovecnm/kubernetes,iameli/kubernetes,sdminonne/kubernetes,nckturner/kubernetes,enj/kubernetes,fanzhangio/kubernetes,mikedanese/kubernetes,k82/kubernetes,micahhausler/kubernetes,verb/kubernetes,olivierlemasle/kubernetes,warmchang/kubernetes,bparees/kubernetes,cofyc/kubernetes,gnufied/kubernetes,kubernetes/kubernetes,tpepper/kubernetes,thockin/kubernetes,zhouhaibing089/kubernetes,nckturner/kubernetes,chrislovecnm/kubernetes,hex108/kubernetes,Acidburn0zzz/kubernetes,roberthbailey/kubernetes,monopole/kubernetes,wongma7/kubernetes,ii/kubernetes,nak3/kubernetes,nak3/kubernetes,saad-ali/kubernetes,iameli/kubernetes,fanzhangio/kubernetes,nak3/kubernetes,dims/kubernetes,ravilr/kubernetes,saad-ali/kubernetes,aledbf/kubernetes,BenTheElder/kubernetes,jackfrancis/kubernetes,gnufied/kubernetes,wongma7/kubernetes,jingxu97/kubernetes,rnaveiras/kubernetes,micahhausler/kubernetes,dlorenc/kubernetes,nikhita/kubernetes,jessfraz/kubernetes,PiotrProkop/kubernetes,lojies/kubernetes,kubernetes/kubernetes,jsafrane/kubernetes,mkumatag/kubernetes,zhangmingld/kubernetes,dixudx/kubernetes,verult/kubernetes,cblecker/kubernetes,alejandroEsc/kubernetes,zhouhaibing089/kubernetes,rrati/kubernetes,ravilr/kubernetes,liggitt/kubernetes,soltysh/kubernetes,kubernetes/kubernetes,verb/kubernetes,monopole/kubernetes,spzala/kubernetes,ii/kubernetes,k82/kubernetes,idvoretskyi/kubernetes,lojies/kubernetes,soltysh/kubernetes,verb/kubernetes,tpepper/kubernetes,jackfrancis/kubernetes,gnufied/kubernetes,dlorenc/kubernetes,andrewrynhard/kubernetes,mosoft521/kubernetes,tengqm/kubernetes,feiskyer/kubernetes,jagosan/kubernetes,ii/kubernetes,tpepper/kubernetes,tengqm/kubernetes,iameli/kubernetes,tpepper/kubernetes,sdminonne/kubernetes,linux-on-ibm-z/kubernetes,enj/kubernetes,x13n/kubernetes,krmayankk/kubernetes,mikedanese/kubernetes,MikeSpreitzer/kubernetes,idvoretskyi/kubernetes,rnaveiras/kubernetes,kevin-wangzefeng/kubernetes,dereknex/kubernetes,lojies/kubernetes,olivierlemasle/kubernetes,zhouhaibing089/kubernetes,PI-Victor/kubernetes,cofyc/kubernetes,jingxu97/kubernetes,nak3/kubernetes,wongma7/kubernetes,BenTheElder/kubernetes,dereknex/kubernetes,warmchang/kubernetes,fabriziopandini/kubernetes,csrwng/kubernetes,kevin-wangzefeng/kubernetes,matthyx/kubernetes,saad-ali/kubernetes,spzala/kubernetes,x13n/kubernetes,ping035627/kubernetes,mosoft521/kubernetes,Clarifai/kubernetes,mikedanese/kubernetes,liggitt/kubernetes,kevin-wangzefeng/kubernetes,mikebrow/kubernetes,cofyc/kubernetes,mkumatag/kubernetes,x13n/kubernetes,rafax/kubernetes,andrewrynhard/kubernetes,linux-on-ibm-z/kubernetes,aledbf/kubernetes,fabriziopandini/kubernetes,dixudx/kubernetes,BenTheElder/kubernetes,mahak/kubernetes,ping035627/kubernetes,x13n/kubernetes,matthyx/kubernetes,fanzhangio/kubernetes,andrewrynhard/kubernetes,fanzhangio/kubernetes,iameli/kubernetes,Clarifai/kubernetes,chestack/kubernetes,jagosan/kubernetes,andrewrynhard/kubernetes,PI-Victor/kubernetes,chrislovecnm/kubernetes,mikedanese/kubernetes,k82/kubernetes,liggitt/kubernetes,humblec/kubernetes,jagosan/kubernetes,verult/kubernetes,chestack/kubernetes,deads2k/kubernetes,deads2k/kubernetes,Clarifai/kubernetes,matthyx/kubernetes,MikeSpreitzer/kubernetes,k82cn/kubernetes,weiwei04/kubernetes,ping035627/kubernetes,cblecker/kubernetes,roberthbailey/kubernetes,mengqiy/kubernetes,shyamjvs/kubernetes,Acidburn0zzz/kubernetes,enj/kubernetes,tengqm/kubernetes,dixudx/kubernetes,matthyx/kubernetes,sdminonne/kubernetes,fanzhangio/kubernetes,zhangmingld/kubernetes,jsafrane/kubernetes,nckturner/kubernetes,gnufied/kubernetes,feiskyer/kubernetes,enj/kubernetes,dixudx/kubernetes,csrwng/kubernetes,mkumatag/kubernetes,jingxu97/kubernetes,cblecker/kubernetes,jagosan/kubernetes,kevin-wangzefeng/kubernetes,hex108/kubernetes,aledbf/kubernetes,PI-Victor/kubernetes,feiskyer/kubernetes,MikeSpreitzer/kubernetes,jessfraz/kubernetes,carlory/kubernetes,jsafrane/kubernetes,krmayankk/kubernetes,lojies/kubernetes,nikhita/kubernetes,cblecker/kubernetes,dims/kubernetes,MikeSpreitzer/kubernetes,ping035627/kubernetes,roberthbailey/kubernetes,deads2k/kubernetes,monopole/kubernetes,openshift/kubernetes,idvoretskyi/kubernetes,krmayankk/kubernetes,rnaveiras/kubernetes,alejandroEsc/kubernetes,PiotrProkop/kubernetes,rafax/kubernetes,mengqiy/kubernetes,jessfraz/kubernetes,fabriziopandini/kubernetes,tengqm/kubernetes,Clarifai/kubernetes,wongma7/kubernetes,zhangmingld/kubernetes,andrewrynhard/kubernetes,linux-on-ibm-z/kubernetes,weiwei04/kubernetes,fanzhangio/kubernetes,ravilr/kubernetes,ii/kubernetes,thockin/kubernetes,GulajavaMinistudio/kubernetes,rrati/kubernetes,dlorenc/kubernetes,warmchang/kubernetes,zhouhaibing089/kubernetes,hex108/kubernetes,jackfrancis/kubernetes,thockin/kubernetes,shyamjvs/kubernetes,hex108/kubernetes,dlorenc/kubernetes,nak3/kubernetes,warmchang/kubernetes,PI-Victor/kubernetes,rrati/kubernetes,weiwei04/kubernetes,deads2k/kubernetes,saad-ali/kubernetes,jagosan/kubernetes,aledbf/kubernetes,verb/kubernetes,BenTheElder/kubernetes,spzala/kubernetes,rrati/kubernetes,dereknex/kubernetes,monopole/kubernetes,Clarifai/kubernetes,idvoretskyi/kubernetes,warmchang/kubernetes,weiwei04/kubernetes,mikebrow/kubernetes,mosoft521/kubernetes,fabriziopandini/kubernetes,ii/kubernetes,saad-ali/kubernetes,deads2k/kubernetes,jsafrane/kubernetes,saad-ali/kubernetes,enj/kubernetes,krmayankk/kubernetes,weiwei04/kubernetes,chestack/kubernetes,dereknex/kubernetes,ping035627/kubernetes,rnaveiras/kubernetes,verult/kubernetes,mikedanese/kubernetes,idvoretskyi/kubernetes,verult/kubernetes,liggitt/kubernetes,nak3/kubernetes,dims/kubernetes,nikhita/kubernetes,thockin/kubernetes,openshift/kubernetes,chrislovecnm/kubernetes,jsafrane/kubernetes,cofyc/kubernetes,idvoretskyi/kubernetes,humblec/kubernetes,csrwng/kubernetes,tpepper/kubernetes,k82cn/kubernetes,andrewrynhard/kubernetes,x13n/kubernetes,cblecker/kubernetes,BenTheElder/kubernetes,k82/kubernetes,Acidburn0zzz/kubernetes,chrislovecnm/kubernetes,mosoft521/kubernetes,olivierlemasle/kubernetes,mengqiy/kubernetes,verult/kubernetes,sdminonne/kubernetes,roberthbailey/kubernetes,shyamjvs/kubernetes,humblec/kubernetes,matthyx/kubernetes,tpepper/kubernetes,verult/kubernetes,hex108/kubernetes,x13n/kubernetes,jingxu97/kubernetes,PI-Victor/kubernetes,verb/kubernetes,nikhita/kubernetes,olivierlemasle/kubernetes,fabriziopandini/kubernetes,zhouhaibing089/kubernetes,rnaveiras/kubernetes,ravilr/kubernetes,rafax/kubernetes,monopole/kubernetes,humblec/kubernetes,Clarifai/kubernetes,Acidburn0zzz/kubernetes,zhangmingld/kubernetes,mkumatag/kubernetes,kubernetes/kubernetes,mkumatag/kubernetes,jingxu97/kubernetes,spzala/kubernetes,mahak/kubernetes,mosoft521/kubernetes,tengqm/kubernetes,soltysh/kubernetes,dlorenc/kubernetes,openshift/kubernetes,micahhausler/kubernetes,Acidburn0zzz/kubernetes,jackfrancis/kubernetes,nckturner/kubernetes,dims/kubernetes,GulajavaMinistudio/kubernetes,GulajavaMinistudio/kubernetes,cofyc/kubernetes,PiotrProkop/kubernetes,chestack/kubernetes,lojies/kubernetes,dereknex/kubernetes,alejandroEsc/kubernetes,chestack/kubernetes,mikebrow/kubernetes,alejandroEsc/kubernetes,li-ang/kubernetes,zhangmingld/kubernetes,krmayankk/kubernetes,linux-on-ibm-z/kubernetes,feiskyer/kubernetes,soltysh/kubernetes,bparees/kubernetes,gnufied/kubernetes,chrislovecnm/kubernetes,carlory/kubernetes,weiwei04/kubernetes,li-ang/kubernetes,k82cn/kubernetes,cofyc/kubernetes,csrwng/kubernetes,linux-on-ibm-z/kubernetes,shyamjvs/kubernetes,soltysh/kubernetes,mahak/kubernetes,PiotrProkop/kubernetes,nikhita/kubernetes,sdminonne/kubernetes,k82/kubernetes,ravilr/kubernetes,k82cn/kubernetes,MikeSpreitzer/kubernetes,PiotrProkop/kubernetes,li-ang/kubernetes,GulajavaMinistudio/kubernetes,nckturner/kubernetes,csrwng/kubernetes,jessfraz/kubernetes,mikebrow/kubernetes,hex108/kubernetes,rrati/kubernetes,jackfrancis/kubernetes,mikebrow/kubernetes,aledbf/kubernetes,alejandroEsc/kubernetes,dlorenc/kubernetes,wongma7/kubernetes,iameli/kubernetes,roberthbailey/kubernetes,carlory/kubernetes,GulajavaMinistudio/kubernetes