Skip to content

Commit 4c69bf2

Browse files
committed
implement GetResetFieldsFilter
GetResetFieldsFilter returns a set of fields filter reset by pod resize strategy. This is needed to make server-side apply work correctly.
1 parent 0a80c5e commit 4c69bf2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/registry/core/pod/strategy.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,17 @@ func (podResizeStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.
321321
return nil
322322
}
323323

324+
// GetResetFieldsFilter returns a set of fields filter reset by the strategy
325+
// and should not be modified by the user.
326+
func (podResizeStrategy) GetResetFieldsFilter() map[fieldpath.APIVersion]fieldpath.Filter {
327+
return map[fieldpath.APIVersion]fieldpath.Filter{
328+
"v1": fieldpath.NewIncludeMatcherFilter(
329+
fieldpath.MakePrefixMatcherOrDie("spec", "containers", fieldpath.MatchAnyPathElement(), "resources"),
330+
fieldpath.MakePrefixMatcherOrDie("spec", "containers", fieldpath.MatchAnyPathElement(), "resizePolicy"),
331+
),
332+
}
333+
}
334+
324335
// dropPodUpdates drops any changes in the pod.
325336
func dropPodUpdates(newPod, oldPod *api.Pod) *api.Pod {
326337
pod := oldPod.DeepCopy()

0 commit comments

Comments
 (0)