Answer
During the reign of John Casimir in the 17th century, the Cossacks were primarily under the rule of the Tsar of Russia. Their allegiance shifted between the Polish-Lithuanian Commonwealth and the Russian Empire due to various political, religious, and territorial conflicts in the region. The Cossacks played a significant role in the numerous conflicts and uprisings that shaped the geopolitical landscape of Eastern Europe during that period.