diff --git a/controller/instance_manager_controller.go b/controller/instance_manager_controller.go index 7ad59550cc..c5391bff64 100644 --- a/controller/instance_manager_controller.go +++ b/controller/instance_manager_controller.go @@ -521,10 +521,6 @@ func (imc *InstanceManagerController) isDateEngineCPUMaskApplied(im *longhorn.In } func (imc *InstanceManagerController) syncLogSettingsToInstanceManagerPod(im *longhorn.InstanceManager) error { - if types.IsDataEngineV1(im.Spec.DataEngine) { - return nil - } - if im.Status.CurrentState != longhorn.InstanceManagerStateRunning { return nil } @@ -535,6 +531,21 @@ func (imc *InstanceManagerController) syncLogSettingsToInstanceManagerPod(im *lo } defer client.Close() + if types.IsDataEngineV1(im.Spec.DataEngine) { + settingName := types.SettingNameLogLevel + setting, err := imc.ds.GetSettingWithAutoFillingRO(settingName) + if err != nil { + return err + } + + err = client.LogSetLevel(longhorn.DataEngineTypeV1, "", setting.Value) + if err != nil { + return errors.Wrapf(err, "failed to set instance-manager log level from %v", settingName) + } + + return nil + } + settingNames := []types.SettingName{ types.SettingNameV2DataEngineLogLevel, types.SettingNameV2DataEngineLogFlags,