[IMPROVEMENT] Prevent unnecessary updates of instanceManager status #8420
Labels
backport/1.5.6
backport/1.6.2
component/longhorn-manager
Longhorn manager (control plane)
kind/improvement
Request for improvement of existing function
require/backport
Require backport. Only used when the specific versions to backport have not been definied.
require/manual-test-plan
Require adding/updating manual test cases if they can't be automated
Milestone
Is your improvement request related to a feature? Please describe (👍 if you like this request)
If the engine or replica process map from an instance manager is empty,
instanceManager.status.InstanceEngines
orinstanceManager.status.InstanceReplicas
will be anil
map.reflect.DeepEqual
function treats two mapsvar m1 map[string]process
andm2 := map[string]process
as different maps. Therefore, to prevent unnecessary updates, we must check both that the length of the maps is zero and that the maps are identical.https://github.com/longhorn/longhorn-manager/blob/master/controller/instance_manager_controller.go#L1636-L1638
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: