There are 4-criteria to consider before pulling the trigger. Simply having a knife that you are aware of only represents one of the four, and that is means.
A knife is a weapon that affords the opportunity of doing harm to somebody else, but there needs to be opportunity and intent to go along with the means. Somebody with a knife that is 50-yds away does not have the opportunity to threaten somebody at that distance. 7-yds is a different story. At 7-yds, the person with with knife may have opportunity, but are they displaying intent. Talking tough with a knife at 7-yds could be borderline intent, whereas, charging at 7-yds is clear intent. Then, you have the 4th criteria, which is preclusion. Do you have the ability to remove your yourself from the incident and is nobody else in jeopardy if you simply flee. In the end, you'll need to justify that your life or some other life was in jeopardy to justify a shot.
I.M.O.P. Principle