The military works for the civilian leadership, not the other way around.
That is exactly what I was taught during my officer training way back in the 60s.
I was fortunate that in my really 'interesting' period, when my decision making was really important, I had Maggie as PM & Ronnie was President.
I was also very fortunate not to have to put my life on the line for a numbskull like Obama. He's so bad he almost makes Carter look like a genius.