Top leaks in a closet are usually connections rather than tank failures, which is good news: the parts are replaceable. The difficulty is access, not diagnosis.
Fittings in a closet
Where the unit sits in a closet, the top is usually connected with braided flex lines rather than rigid pipe, because the install has to be made in a space too tight for soldering. Those lines have a rubber core and a crimped end, and both are wear items: the crimp loosens, the core perishes, and the drip starts at the top and shows at the bottom of the unit.
Swapping a flex line is a short job. Getting to it past a shelf, a laundry box or a duct is what takes the time, and it is also why a top leak here is often first reported as a bottom one.
The relief valve
A temperature-and-pressure valve that weeps or discharges is either failing or reporting a condition. A worn seat drips; a valve lifting under pressure is telling you about expansion or supply pressure. Capping it is never the answer.
In a closet, the discharge line may disappear into a wall or a floor drain. Checking that route is part of the repair, because a valve that is working correctly still needs somewhere safe to discharge.
Sweat, not a leak
A closet that also holds a washer, a dryer or a bathroom extract shares its air with a lot of moisture. Cold water arriving in a warm, damp space beads on the pipe and the fittings and runs down to the same place a leak would.
The tell is timing: condensation appears in humid weather or after heavy use, and it does not change when the inlet is closed. Drying the surfaces and watching them for a day settles it before a fitting is disturbed.
When the shell is finished
Corrosion at the top head is a different verdict from a failed union. The area is cleaned, the metal is watched rather than the joint, and if the water is coming through the head itself the tank is done. In a tower that decision involves the building, since the unit and the riser are not the resident's alone.
The visit and the shutoff
The inlet is closed at the unit where there is a valve, or at the riser where there is not, and that is the point at which the building engineer may need to be involved. Each top fitting is checked, the failed one replaced and the rest tested under pressure. The relief valve is exercised and its discharge followed to a safe end point. If it lifted on its own, pressure is measured before a cure is proposed.