returnadmission.NewForbidden(a,fmt.Errorf("unexpected type %T",a.GetObject()))
}
// make copies for comparison
oldPVC=oldPVC.DeepCopy()
newPVC=newPVC.DeepCopy()
// zero out resourceVersion to avoid comparing differences,
// since the new object could leave it empty to indicate an unconditional update
oldPVC.ObjectMeta.ResourceVersion=""
newPVC.ObjectMeta.ResourceVersion=""
oldPVC.Status.Capacity=nil
newPVC.Status.Capacity=nil
oldPVC.Status.Conditions=nil
newPVC.Status.Conditions=nil
// ensure no metadata changed. nodes should not be able to relabel, add finalizers/owners, etc
if!apiequality.Semantic.DeepEqual(oldPVC,newPVC){
returnadmission.NewForbidden(a,fmt.Errorf("node %q may not update fields other than status.capacity and status.conditions: %v",nodeName,diff.ObjectReflectDiff(oldPVC,newPVC)))