pretty sure apple can't legally invalidate your warranty since hard drives and rams fall under protected user-replaceable parts.
what they can do is ask you to put the old harddrive back before they service your computer.
Not anymore since the rMBPs.
Even opening the back panel will void it. At least here in Australia.
Ugh that sucks