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)))
returnadmission.NewForbidden(a,fmt.Errorf("the UID in the bound object reference (%s) does not match the UID in record (%s). The object might have been deleted and then recreated",ref.UID,pod.UID))
}
ifpod.Spec.NodeName!=nodeName{
returnadmission.NewForbidden(a,fmt.Errorf("node requested token bound to a pod scheduled on a different node"))
"spec":"Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status",
}
func(Lease)SwaggerDoc()map[string]string{
returnmap_Lease
}
varmap_LeaseList=map[string]string{
"":"LeaseList is a list of Lease objects.",
"metadata":"Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
"items":"Items is a list of schema objects.",
}
func(LeaseList)SwaggerDoc()map[string]string{
returnmap_LeaseList
}
varmap_LeaseSpec=map[string]string{
"":"LeaseSpec is a specification of a Lease.",
"holderIdentity":"holderIdentity contains the identity of the holder of a current lease.",
"leaseDurationSeconds":"leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime.",
"acquireTime":"acquireTime is a time when the current lease was acquired.",
"renewTime":"renewTime is a time when the current holder of a lease has last updated the lease.",
"leaseTransitions":"leaseTransitions is the number of transitions of a lease between holders.",