mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
add markers for inspected validation mutation hits
This commit is contained in:
parent
bd5b1e2d05
commit
5570a81040
@ -2035,7 +2035,7 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *core.PersistentVolumeCl
|
||||
// Claims are immutable in order to enforce quota, range limits, etc. without gaming the system.
|
||||
if len(oldPvc.Spec.VolumeName) == 0 {
|
||||
// volumeName changes are allowed once.
|
||||
oldPvcClone.Spec.VolumeName = newPvcClone.Spec.VolumeName
|
||||
oldPvcClone.Spec.VolumeName = newPvcClone.Spec.VolumeName // +k8s:verify-mutation:reason=clone
|
||||
}
|
||||
|
||||
if validateStorageClassUpgrade(oldPvcClone.Annotations, newPvcClone.Annotations,
|
||||
@ -2051,7 +2051,7 @@ func ValidatePersistentVolumeClaimUpdate(newPvc, oldPvc *core.PersistentVolumeCl
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.ExpandPersistentVolumes) {
|
||||
// lets make sure storage values are same.
|
||||
if newPvc.Status.Phase == core.ClaimBound && newPvcClone.Spec.Resources.Requests != nil {
|
||||
newPvcClone.Spec.Resources.Requests["storage"] = oldPvc.Spec.Resources.Requests["storage"]
|
||||
newPvcClone.Spec.Resources.Requests["storage"] = oldPvc.Spec.Resources.Requests["storage"] // +k8s:verify-mutation:reason=clone
|
||||
}
|
||||
|
||||
oldSize := oldPvc.Spec.Resources.Requests["storage"]
|
||||
@ -2430,13 +2430,13 @@ func GetVolumeMountMap(mounts []core.VolumeMount) map[string]string {
|
||||
}
|
||||
|
||||
func GetVolumeDeviceMap(devices []core.VolumeDevice) map[string]string {
|
||||
voldevices := make(map[string]string)
|
||||
volDevices := make(map[string]string)
|
||||
|
||||
for _, dev := range devices {
|
||||
voldevices[dev.Name] = dev.DevicePath
|
||||
volDevices[dev.Name] = dev.DevicePath
|
||||
}
|
||||
|
||||
return voldevices
|
||||
return volDevices
|
||||
}
|
||||
|
||||
func ValidateVolumeMounts(mounts []core.VolumeMount, voldevices map[string]string, volumes map[string]core.VolumeSource, container *core.Container, fldPath *field.Path) field.ErrorList {
|
||||
|
@ -1409,7 +1409,7 @@ func validateAPIApproval(newCRD, oldCRD *apiextensions.CustomResourceDefinition,
|
||||
var oldApprovalState *apihelpers.APIApprovalState
|
||||
if oldCRD != nil {
|
||||
t, _ := apihelpers.GetAPIApprovalState(oldCRD.Annotations)
|
||||
oldApprovalState = &t
|
||||
oldApprovalState = &t // +k8s:verify-mutation:reason=clone
|
||||
}
|
||||
newApprovalState, reason := apihelpers.GetAPIApprovalState(newCRD.Annotations)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user