What if the resident came out, yelled at them and then the undercover police started blazing away?
It would depend on the rest of the facts. The resident was apparently brandishing a gun. It is possible to do this in a way that is illegal and threatening and would give the cops the legal right to shoot first in self-defense. Possible, I say. I have no idea whether that is what happened in this particular case, but neither do any of the others on this thread who are condemning the officers.