Exactly like that. During the apartheid era South Africa was short on friends and trading partners and Israel was short on friends and trading partners so they got together for mutual benefit and whilst Israel may not have approved of apartheid it wasn't willing to put sacrifice the economic benefits it received from doing business with SA out of a morality. Enforcement of sanctions is a luxury only the rich countries can afford and the poorer ones look for friends where they can find them even if everybody else thinks its immoral. The west can introduce sanctions on Iran but Russia, China, North Korea and plenty of others I imagine will be lining up to do business with Iran.
Austrian police say they expect 10,000 migrants to arrive from Hungary (DPA)
from the article: Iran Navy acquires new submarines amidst nuclear tension