David and Joab
"... The king answered, “I'm going to ask you a question, and you must tell me the whole truth.” “Ask me anything, Your Majesty,” she answered. “Did Joab put you up to this?” he asked her.
She answered, “I swear by all that is sacred, Your Majesty, that there is no way to avoid answering your question. It was indeed your officer Joab who told me what to do and what to say. But he did it in order to straighten out this whole matter. Your Majesty is as wise as the angel of God and knows everything that happens.”
Later on the king said to Joab, “I have decided to do what you want. Go and get the young man Absalom and bring him back here.” ..."
~ 2 Samuel 14 GNB
Nobody was willing to stand up to the king. But Joab trusted David's wisdom and, as importantly, Joab trusted that David trusted him.
Even later on in chapter 18 and 19, when Absalom wanted to topple David, it was Joab who killed Absalom and rebuked David of his leadership in the aftermath.
David was confident that Joab had the king's best interest in mind. That is trust that was forged in many life and death situations between David and Joab.