Repository: kubernetes/kubernetes (language: go)

Issue:
Field name mismatch in PVC status validation
https://github.com/kubernetes/kubernetes/blob/ff25881bc1fe9da1dda4ec82d294b92078ae2763/pkg/apis/core/validation/validation.go#L2542

In this line, the field is set to "allocatedResourceStatus", but the PersistentVolumeClaimStatus class declares it as "AllocatedResourceStatuses"(consistent with the documentation). I'm unsure why "allocatedResourceStatus" is used here.Is this a typo, or is there a mapping logic we're missing?


Discussion / hints:
This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the `triage/accepted` label and provide further guidance.

The `triage/accepted` label can be added by org members by writing `/triage accepted` in a comment.


<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
</details>
/sig storage

The API  test data  and related code consistently use "allocatedResourceStatuses", while the validation function references "allocatedResourceStatus" 
I am sure seems like a BUG to me
/kind bug
/retitle Field name mismatch in PVC status validation

Fix patch:
diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go
index fa96a72324484..6ed1f826b1abf 100644
--- a/pkg/apis/core/validation/validation.go
+++ b/pkg/apis/core/validation/validation.go
@@ -2539,7 +2539,7 @@ func ValidatePersistentVolumeClaimStatusUpdate(newPvc, oldPvc *core.PersistentVo
 		allErrs = append(allErrs, validateBasicResource(qty, capPath.Key(string(r)))...)
 	}
 	if validationOpts.EnableRecoverFromExpansionFailure {
-		resizeStatusPath := field.NewPath("status", "allocatedResourceStatus")
+		resizeStatusPath := field.NewPath("status", "allocatedResourceStatuses")
 		if newPvc.Status.AllocatedResourceStatuses != nil {
 			resizeStatus := newPvc.Status.AllocatedResourceStatuses
 			for k, v := range resizeStatus {


Test patch: