Onion rust is a disease caused by the Puccini all fungus, the same rust fungi that attack roses.
How to control rust
To break the cycle of onion rust, rotate all Allium crops every 2 -3 years and discard any infected plant tissue. Other common Allium crops include leeks, scallions, and garlic. Avoid excessive irrigation and remove all dead or diseased plant material.
I hope this information inspires you to grow more of your own food. You can ask your garden questions on my Home page.