Do not reset managedFields in status update strategy
This commit is contained in:
@@ -94,7 +94,12 @@ var StatusStrategy = flowSchemaStatusStrategy{Strategy}
|
||||
func (flowSchemaStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
|
||||
newFlowSchema := obj.(*flowcontrol.FlowSchema)
|
||||
oldFlowSchema := old.(*flowcontrol.FlowSchema)
|
||||
|
||||
// managedFields must be preserved since it's been modified to
|
||||
// track changed fields in the status update.
|
||||
managedFields := newFlowSchema.ManagedFields
|
||||
newFlowSchema.ObjectMeta = oldFlowSchema.ObjectMeta
|
||||
newFlowSchema.ManagedFields = managedFields
|
||||
newFlowSchema.Spec = oldFlowSchema.Spec
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,12 @@ var StatusStrategy = priorityLevelConfigurationStatusStrategy{Strategy}
|
||||
func (priorityLevelConfigurationStatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object) {
|
||||
newPriorityLevelConfiguration := obj.(*flowcontrol.PriorityLevelConfiguration)
|
||||
oldPriorityLevelConfiguration := old.(*flowcontrol.PriorityLevelConfiguration)
|
||||
|
||||
// managedFields must be preserved since it's been modified to
|
||||
// track changed fields in the status update.
|
||||
managedFields := newPriorityLevelConfiguration.ManagedFields
|
||||
newPriorityLevelConfiguration.ObjectMeta = oldPriorityLevelConfiguration.ObjectMeta
|
||||
newPriorityLevelConfiguration.ManagedFields = managedFields
|
||||
newPriorityLevelConfiguration.Spec = oldPriorityLevelConfiguration.Spec
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user