fair-weather friendship

Etymology
From.

Noun

 * 1) A friendship that is utilitarian and opportunistic.