IIRC all flag officers must pass senate approval.
You’re right. But they are nominated by the president.