Yesterday Secretary of Defense Robert Gates made an unprecedented public comment in testimony on the Libyan war:

Mr. Gates told Congress that he strongly opposed putting any United States forces in Libya. Asked if there would be American “boots on the ground” — uniformed members of the military — Mr. Gates swiftly replied, “Not as long as I’m in this job.”

Wait a minute. If that is his advice to the president, shouldn’t it be given in private? Frankly, it sounds like he is publicly threatening to resign should the president, his boss and the commander in chief, ever decide to put “boots on the ground.” It is the president’s choice, but Gates is suggesting that he has the president over a barrel. This is, in a word, indefensible.

In 2009 during the Afghanistan strategy review Gates certainly understood the propriety of public leaks and comments:

Defense Secretary Robert M. Gates appeared to subtly rebuke America’s top commander in Afghanistan on Monday for publicly speaking out against calls for scaling back the war effort there.

“I believe the decisions that the president will make for the next stage of the Afghanistan campaign will be among the most important of his presidency, so it is important that we take our time to do all we can to get this right,” Mr. Gates said at a gathering here.

“And in this process,” Mr. Gates went on, “it is imperative that all of us taking part in these deliberations — civilians and military alike — provide our best advice to the president candidly but privately.”

He added that “once the commander in chief makes his decisions, we will salute and execute those decisions faithfully and to the best of our ability.” And presumably not threaten to quit if he should change his mind.

In 2010 Gates “strongly supported” the firing of Gen. Stanley McChrystal, who spoke disparagingly of civilian commanders to a Rolling Stone reporter. There was widespread agreement that McChrystal, while technically not insubordinate, had shown disrespect for the chain of command:

Sen. John McCain, R-Ariz., and other key Senate Armed Services members issued a statement calling McChrystal’s comments “inappropriate and inconsistent with the traditional relationship between Commander-in-Chief and the military.”

Retired Navy vice admiral Rep. Joe Sestak, D-Pa., said that military officers have a responsibility to speak bluntly, but “you say that privately and keep it behind closed doors.”

But Rep. David Obey, chairman of the House Appropriations Committee and a key liberal voice in the House, called McChrystal’s comments “contemptuous of his civilian superiors” and demanded his resignation.

Well,Gates’s defenders may say, in the Libya situation, he is not trash talking the president or disagreeing with current policy. True, but he is insinuating that if the president wants to keep him, he’ll have to go along with Gates’s position on the use of troops. He is inverting the chain of command.

The proper response to whatever queries Gates received about troops was: “I gave my advice to the president in private. He made his decision and I will implement that decision.” But Gates, for reasons unclear to me, had to assert that he was the man with the finger in the dike, the heroic objector to use of ground troops.

Gates is supposed to retire soon. If the president had the gumption he’d accelerate that departure date. For otherwise, how are we to know the president, not Gates, is running the show?