code: func (a *claimDefaulterPlugin) Admit(attr admission.Attributes, o admission.ObjectInterfaces) error {
  	if attr.GetResource().GroupResource() != api.Resource("persistentvolumeclaims") {
  		return nil
  	}
  
  	if len(attr.GetSubresource()) != 0 {
  		return nil
  	}
  
  	pvc, ok := attr.GetObject().(*api.PersistentVolumeClaim)
  	// if we can't convert then we don't handle this object so just return
  	if !ok {
  		return nil
  	}
  
  	if helper.PersistentVolumeClaimHasClass(pvc) {
  		// The user asked for a class.
  		return nil
  	}
  
  	klog.V(4).Infof("no storage class for claim %s (generate: %s)", pvc.Name, pvc.GenerateName)
  
  	def, err := getDefaultClass(a.lister)
  	if err != nil {
  		return admission.NewForbidden(attr, err)
  	}
  	if def == nil {
  		// No default class selected, do nothing about the PVC.
  		return nil
  	}
  
  	klog.V(4).Infof("defaulting storage class for claim %s (generate: %s) to %s", pvc.Name, pvc.GenerateName, def.Name)
  	pvc.Spec.StorageClassName = &def.Name
  	return nil
  }
docs: // Admit sets the default value of a PersistentVolumeClaim's storage class, in case the user did
  // not provide a value.
  //
  // 1.  Find available StorageClasses.
  // 2.  Figure which is the default
  // 3.  Write to the PVClaim