There are 2 main types of glaucoma, the most common is COAG or "chronic open angle glaucoma", where there is either over production of aqueous fluid within the eyeball, or poor drainage of fluid from the anterior chamber. The second, much less common form is acute or "angle closure glaucoma", which is due to the physiological shape of the anterior part of the eyeball. In these patients the anterior chamber is shallow and during certain conditions, primarily low light, possibly related to certain drugs, and even a persons emotional state, the pupil can dilate enough that the ruffled edges of the iris cause a block and the pressure of the eyeball escalates dramatically, to the point that blindness can occur following only one angle closure attack. These patients are usually treated preventatively with a laser that makes pinholes in the iris as an alternative drainage route, typically under the upper lid where they are not visible. Medications are not indicated. As compared to COAG, where the pressure is high but the damage takes years. This type of glaucoma is typically treated with eye drops but surgery can reduce or eliminate the need for meds.
There are a few other types such as pigmentary dispersion syndrome, where the iris sheds pigment which can clog the drainage system of the eyeball, and glaucoma due to trauma to the drainage system. There's another type of glaucoma called "low tension glaucoma" where the anterior chambers are wide open, the IOPs (intraocular pressures) are tested to be within normal ranges and yet there is progressive vision loss consistent with glaucoma. Recent studies have indicated this may not be glaucoma at all rather an underlying undiagnosed neurological issue that masquerades as glaucoma.
Regardless of the type, there is no contraindication to diving with glaucoma.
Oh and it's "ophthalmologist". Surprising the spell check didn't catch that one.