mirror of https://github.com/k3s-io/k3s
Merge pull request #53173 from alrs/fix-strategicpatch-swallowed-errors
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>. Fix strategicpatch swallowed errors **What this PR does / why we need it**: Fixes four dropped error variables in `apimachinery`. ```release-note NONE ```pull/6/head
commit
d52c708b90
|
@ -515,6 +515,9 @@ func normalizeSliceOrder(toSort, order []interface{}, mergeKey string, kind refl
|
|||
return nil, err
|
||||
}
|
||||
toSort, toDelete, err = extractToDeleteItems(toSort)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
sort.SliceStable(toSort, func(i, j int) bool {
|
||||
|
@ -554,7 +557,13 @@ func diffLists(original, modified []interface{}, t reflect.Type, mergeKey string
|
|||
switch kind {
|
||||
case reflect.Map:
|
||||
patchList, deleteList, err = diffListsOfMaps(original, modified, t, mergeKey, diffOptions)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
patchList, err = normalizeSliceOrder(patchList, modified, mergeKey, kind)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
orderSame, err := isOrderSame(original, modified, mergeKey)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
|
@ -580,6 +589,9 @@ func diffLists(original, modified []interface{}, t reflect.Type, mergeKey string
|
|||
return nil, nil, nil, mergepatch.ErrNoListOfLists
|
||||
default:
|
||||
patchList, deleteList, err = diffListsOfScalars(original, modified, diffOptions)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
patchList, err = normalizeSliceOrder(patchList, modified, mergeKey, kind)
|
||||
// generate the setElementOrder list when there are content changes or order changes
|
||||
if diffOptions.SetElementOrder && ((!diffOptions.IgnoreDeletions && len(deleteList) > 0) ||
|
||||
|
|
Loading…
Reference in New Issue