The O-ring groove and the central bore are turned in one pass, with groove width and depth matched to the ring so it cannot extrude under compression.
Tie-rod holes are machined in the same setup as the bore, so the cap centres itself when the barrel goes on.