WASHINGTON — Acting Defense Secretary Patrick Shanahan overcame a major hurdle to obtaining the top Pentagon job on Thursday when an internal ethics investigation cleared him of allegations that he promoted his former employer, Boeing, and disparaged its competitors in official discussions about military contractors.

But while the Defense Department’s inspector general found no evidence to support complaints that Mr. Shanahan “repeatedly dumped” on Boeing’s competitors, it did cite a number of times that he praised the Boeing 787 Dreamliner that he famously rescued as a senior executive at the aircraft maker before joining the government.

Mr. Shanahan took over the top job at the Pentagon in an acting capacity in December, but President Trump has not nominated him to the Senate for approval.

“The evidence showed that Acting Secretary Shanahan fully complied with his ethical obligations and ethical agreements with regard to Boeing and its competitors,” Glenn A. Fine, the acting inspector general, said in a statement on Thursday.