Imam Husain's (as) free will for shahadat

The following narrations is recorded by Sheikh Kulayni in Al-Kafi under the chapter:

"The Imams (as) know when they will die and they die voluntarily - أن الأئمة عليهم السلام يعلمون متى يموتون و أنهم لا يموتون إلا باختيار منهم‏"

عدة من أصحابنا، عن أحمد بن محمد، عن علي بن الحكم، عن سيف بن عميرة، عن عبدالملك بن أعين، عن أبي جعفر (عليه السلام) قال: أنزل الله تعالى النصر على الحسين (عليه السلام) حتى كان [ما] بين السماء والارض ثم خير: النصر، أو لقاء الله، فاختار لقاء الله تعالى

Narrated from Abu Jafar Imam Baqir (as),

"Allah (swt) sent help for Imam al-Husain (as) such that it filled up between the heavens and earth. Then he was given to choose either help or meeting Allah. He, however, choose the meeting of Allah."

[Source: Al-Kafi, Vol.1 Pg. 260]