Unverified Commit 04ca0d54 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #66894 from WanLinghao/token_projected_validation_improve

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. improve serviceaccount projected volume validation error info **What this PR does / why we need it**: Fix a small bug here; We should use srcPath instead fldPath here like other projection volume do which could give info about which source triggered the error. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 3ed8b49e c72491ae
...@@ -1022,7 +1022,7 @@ func validateProjectionSources(projection *core.ProjectedVolumeSource, projectio ...@@ -1022,7 +1022,7 @@ func validateProjectionSources(projection *core.ProjectedVolumeSource, projectio
} }
} }
} }
if projPath := fldPath.Child("serviceAccountToken"); source.ServiceAccountToken != nil { if projPath := srcPath.Child("serviceAccountToken"); source.ServiceAccountToken != nil {
numSources++ numSources++
if !utilfeature.DefaultFeatureGate.Enabled(features.TokenRequestProjection) { if !utilfeature.DefaultFeatureGate.Enabled(features.TokenRequestProjection) {
allErrs = append(allErrs, field.Forbidden(projPath, "TokenRequestProjection feature is not enabled")) allErrs = append(allErrs, field.Forbidden(projPath, "TokenRequestProjection feature is not enabled"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment