Knowing the ending does not ruin the book. Even if you hadn't heard anything about the plot, it becomes clear very quickly how it is going to end. The suspense comes from how it all goes down. Classic Chekhov's gun.
It's an excellent book and I highly recommend it. Very short too, so it's not much of a time commitment.