mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
implement GetResetFieldsFilter
GetResetFieldsFilter returns a set of fields filter reset by pod resize strategy. This is needed to make server-side apply work correctly.
This commit is contained in:
@@ -321,6 +321,17 @@ func (podResizeStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetResetFieldsFilter returns a set of fields filter reset by the strategy
|
||||||
|
// and should not be modified by the user.
|
||||||
|
func (podResizeStrategy) GetResetFieldsFilter() map[fieldpath.APIVersion]fieldpath.Filter {
|
||||||
|
return map[fieldpath.APIVersion]fieldpath.Filter{
|
||||||
|
"v1": fieldpath.NewIncludeMatcherFilter(
|
||||||
|
fieldpath.MakePrefixMatcherOrDie("spec", "containers", fieldpath.MatchAnyPathElement(), "resources"),
|
||||||
|
fieldpath.MakePrefixMatcherOrDie("spec", "containers", fieldpath.MatchAnyPathElement(), "resizePolicy"),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// dropPodUpdates drops any changes in the pod.
|
// dropPodUpdates drops any changes in the pod.
|
||||||
func dropPodUpdates(newPod, oldPod *api.Pod) *api.Pod {
|
func dropPodUpdates(newPod, oldPod *api.Pod) *api.Pod {
|
||||||
pod := oldPod.DeepCopy()
|
pod := oldPod.DeepCopy()
|
||||||
|
Reference in New Issue
Block a user