He wasn't, and despite the complaints, he didn't. I will concede that the relationship with Palpatine was implied more than revealed, but there are a lot of steps towards his turning.
"but there are a lot of steps towards his turning."
Not in the movie there aren't. He changes his mind 100% in a matter of minutes with no feasible explanation.