Fair weather friend

1. A person who is your friend only when things are going well.