There is no such thing as international law. It is a myth. It is a fiction created by the capitalist class to cloak its exercise of naked ambition.
A law, as most people understand it, is a rule which is enforced by a state. For so called international law there is no international enforcement authority. The United Nations is not a state and it has no independent enforcement powers. It is a diplomatic congress. Its members are not bound by its edicts, and it is incapable of issuing any edicts which are not unanimously agreed by every member of the Security Council. The UN cannot enforce a rule that one country must not encroach on the sovereignty of another country. The number of encroachments on national sovereignty that have occurred since the establishment of the UN proves this.
A brief internet search for wars since 1945 reveals dozens of such conflicts.
Recent conflicts have illustrated the myth of international law.
When Iraq invaded Iran in 1980 it started an 8-year conflict that caused over a million casualties and approximately 500,000 deaths. Throughout the conflict the aggressor, Iraq, was supported and supplied by the USA, Russia, France and other countries. They all turned a blind eye to the use of chemical weapons against Iran. The rule of international law was no obstacle when the strategic interests of those countries was at stake.
The 2003 invasion of Iraq by the USA and the UK was another example of imperialist interests taking precedence over the international law which both countries professed to uphold. When the interests of their national capitalist class were at stake, the CIA and MI6 propaganda machines went into overdrive to emphasise the brutality of the Iraqi regime. The same regime whose brutality they had sponsored for 8 years.
International law, when it is discussed by the chattering classes, is actually no more than a series of treaties and agreements between countries. And like any treaty, it is not worth the paper it is written on. Treaties are agreed, and then treaties are broken. A treaty is no more than an agreement between two or more countries. And treaties continue to be in force for as long as the parties to that treaty want them to be in force.