code: func (p *priorityPlugin) validatePriorityClass(a admission.Attributes) error {
  	operation := a.GetOperation()
  	pc, ok := a.GetObject().(*scheduling.PriorityClass)
  	if !ok {
  		return errors.NewBadRequest("resource was marked with kind PriorityClass but was unable to be converted")
  	}
  	// If the new PriorityClass tries to be the default priority, make sure that no other priority class is marked as default.
  	if pc.GlobalDefault {
  		dpc, err := p.getDefaultPriorityClass()
  		if err != nil {
  			return fmt.Errorf("failed to get default priority class: %v", err)
  		}
  		if dpc != nil {
  			// Throw an error if a second default priority class is being created, or an existing priority class is being marked as default, while another default already exists.
  			if operation == admission.Create || (operation == admission.Update && dpc.GetName() != pc.GetName()) {
  				return admission.NewForbidden(a, fmt.Errorf("PriorityClass %v is already marked as default. Only one default can exist", dpc.GetName()))
  			}
  		}
  	}
  	return nil
  }
docs: // validatePriorityClass ensures that the value field is not larger than the highest user definable priority. If the GlobalDefault is set, it ensures that there is no other PriorityClass whose GlobalDefault is set.