Peter Bergen is CNN's national security analyst, a vice president at New America and a professor of practice at Arizona State University. He is the author of " United States of Jihad: Investigating America's Homegrown Terrorists ." The opinions expressed in this commentary are his own. View more opinion articles at CNN.

(CNN) Dan Coats, the director of national intelligence, is resigning, according to a tweet on Sunday from President Donald Trump.

Coats' departure was utterly predictable because he performed his job, which was to tell the truth. Unfortunately, his boss didn't like those truths.

On many of the key foreign policy and national security issues of the Trump administration -- Iran, ISIS, North Korea and Russia -- the director of national intelligence and the President fundamentally disagreed about the facts. So naturally Trump is nominating Rep. John Ratcliffe (R-Tex) as his candidate to replace Coats -- with the principal qualification for the job appearing to be his unquestioning fealty to Trump.

Trump's animus against Coats began in earnest when he testified about the findings of the " Worldwide Threat Assessment of the US Intelligence Community " to the Senate Intelligence Committee on January 29.

The assessment is an annual report of the 17 American intelligence agencies are overseen by the Director of National Intelligence. The report generally attracts scant political controversy since it is widely understood to be an objective recounting of the threats that the United States faces.

2019's Worldwide Threat Assessment would be different. Coats testified that North Korea was "unlikely to completely give up its nuclear weapons and production capability because its leaders ultimately view nuclear weapons as critical to regime survival."

JUST WATCHED Who is DNI Dan Coats? Replay More Videos ... MUST WATCH Who is DNI Dan Coats? 01:45

Trump was said to be " enraged " by the coverage of Coats' testimony, which he believed undercut his efforts with the North Koreans to have them agree to complete "denuclearization."

Experts on North Korea almost universally believe that it is quite doubtful that North Korean dictator Kim Jong Un will give up all his nukes.

Iran and ISIS

Coats also testified that the 2015 Iran nuclear agreement was working: "We continue to assess that Iran is not currently undertaking the key nuclear weapons-development activities we judge necessary to produce a nuclear device." If that was the case, why was Trump constantly claiming that Iran was a big threat and the Iran nuclear agreement was a terrible deal?

The morning after Coat's testimony, Trump let loose a tweetstorm writing, "The Intelligence people seem to be extremely passive and naive when it comes to the dangers of Iran. They are wrong!"

The President also tweeted , "Perhaps Intelligence should go back to school!"

Once Trump starts publicly contradicting his top aides they are generally toast. It would only be a matter of the time and the method for the inevitable parting of ways.

In the threat assessment, Coats also explained that, "ISIS still commands thousands of fighters in Iraq and Syria, and it maintains eight branches, more than a dozen networks, and thousands of dispersed supporters around the world, despite significant leadership and territorial losses." This contradicted Trump's frequent claims that ISIS was dead.

The Russia clash

All this came around six months after Trump and Coats had publicly disagreed about Russia. On July 16, 2018 Trump met in Finland with Russian President Vladimir Putin for a two-hour meeting that included no other officials.

At a news conference in the Finnish capital, Helsinki, standing next to Putin , instead of endorsing the unanimous finding of US intelligence agencies that Russia had interfered in the 2016 presidential election, Trump observed that Putin was "extremely strong and powerful in his denial ... He just said 'it's not Russia.' I will say this, I don't see any reason why it would be."

Trump then dumped on his own country saying, "I think that the United States has been foolish. I think we've all been foolish... I think we're all to blame." In fact, as special counsel Robert Mueller's investigation had discovered, the ones to blame were a group of officers in Russia's military intelligence agency, GRU.

Within hours of Trump's news conference Coats released a statement pushing back on Trump saying, "We have been clear in our assessments of Russian meddling in the 2016 election and their ongoing, pervasive efforts to undermine our democracy ..." It was an unusually direct public rebuke from Coats, a longtime conservative Republican.

Three days later, NBC's Andrea Mitchell interviewed Coats at the Aspen Security Forum. In the middle of the interview, a producer handed a note to Mitchell that flagged some breaking news. Mitchell told Coats that Trump had just invited Putin to the White House in the fall.

Coats looked so surprised that it looked like he might be just pulling Mitchell's leg. Of course, the director of national intelligence knew that Putin was going to be visiting the White House!

The Aspen audience began to realize that Coats wasn't joking when he said, "Say that again?"

Coats then added with a soupçon of sarcasm, "Okay ...That's going to be special."

Trump is nominating Ratcliffe, a three-term House member and former federal prosecutor who previously was the mayor of Heath, Texas, population just under 9,000, to be the next director of national intelligence

Coats, by contrast, had served in the Senate and House for two and half decades and was also US ambassador to Germany for four years.

A key qualification for the job seems to be the excoriating attack Ratcliffe made on special counsel Robert Mueller when he testified last week about his report on Russian interference in the 2016 election. Radcliffe's attack seemed largely designed to appeal to the audience of one that he knew would be watching.

When Coats was in the Senate, he served with a senator who famously observed that "Everyone is entitled to his own opinion, but not to his own facts."

Stay up to date... Sign up for our new newsletter. Join us on Twitter and Facebook

Trump seems to want to reverse Sen. Daniel Patrick Moynihan's well-known dictum so it now is, "I'm entitled to my own facts, which will match my opinions."