Sir Keir Starmer said legal certainty was required over the future of the Diego Garcia military base.