I agree with the prior answer. You have a powerful union, and you should consult with your union representative, to see what their view is. Independently, you should see your GP and get a referral to a specialist who can determine what your condition is, and what needs to be done to accommodate the condition, which is probably a "disability" within the meaning of California law. Then, you can present the doctor's letter to your employer with a request that they "engage in the interactive process" to identify a workable accommodation. And, since all this is arising out of your work, be sure to state that to your physicians, because they will be presenting a workers compensation claim for compensation. You need to identify a workers compensation attorney who is familiar with the prison setting and consult with them. If exposure to pepper spray is an absolutely unavoidable aspect of your work, and there is no position available for which you are qualified that doesn't involve exposure to pepper spray, it is conceivable you may have to retire as a last resort. But, there are far worse fates in life than work-related disability retirement for law enforcement personnel. Good luck!
This response creates no attorney client relationship; consult a local lawyer for help if you proceed.
You may want to consult with a doctor and if your doctor agrees with your analysis, ask your employer for a reasonable accommodation. Is there a job you can do that won't be around the pepper spray?