That view is wrong.
The claim that the murder of Soleimani was necessary because of an 'imminent threat' has been debunked by Trump himself when he tweeted that 'it doesn't really matter' if there was such a threat or not.
In a speech at the Hoover Institute Secretary of State Mike Pompeo said that the assassination was part of a new deterrence strategy. As Reuters reported:
U.S. Secretary of State Mike Pompeo on Monday said Qassem Soleimani was killed as part of a broader strategy of deterring challenges by U.S. foes that also applies to China and Russia, further diluting the assertion that the top Iranian general was struck because he was plotting imminent attacks on U.S. targets.
In his speech at Stanford University's Hoover Institute, Pompeo made no mention of the threat of imminent attacks planned by Soleimani.
The speech itself, headlined The Restoration of Deterrence: The Iranian Example, makes that less explicit as Reuters lets it appear:
On the 3rd of this month, we took one of the world's deadliest terrorists off the battlefield for good.