Washington (CNN) Retired Army Gen. Stanley McChrystal, following President Donald Trump's recent swipe at retired Adm. William McRaven, said Monday that the military needed "confidence" in its leaders' values.

"We have certain things we want and demand of leaders," McChrystal told CNN's Jim Sciutto on "Newsroom." "And to a degree, there has to be a confidence in the leader's basic core values. We have to be able to believe in enough of what that leader represents to feel comfortable following them, sometimes to our deaths."

McChrystal, who commanded forces in Afghanistan, said he knew McRaven and pushed back on Trump's attacks against him. He also said Trump's actions were revealing, including Trump's decision not to visit Arlington National Cemetery on the most recent Veterans' Day.

"I think there's a certain honesty to what's happening now," McChrystal said. "The President didn't go to Arlington Cemetery for Veterans' Day, and maybe that's honest, because if you really don't care, it would be dishonest to pretend that you do."

McRaven is best known as the architect of the raid that killed Osama bin Laden, and he has criticized Trump in the past, particularly for his attacks on former CIA Director John Brennan and the press. Asked about McRaven's criticism in a Fox News interview, Trump dismissed the former general repeatedly as a supporter of Hillary Clinton.

Read More