diff --git a/controller/engine_image_controller.go b/controller/engine_image_controller.go index b1d8d880f9..4b222f1341 100644 --- a/controller/engine_image_controller.go +++ b/controller/engine_image_controller.go @@ -515,7 +515,8 @@ func (ic *EngineImageController) canDoOfflineEngineImageUpgrade(v *longhorn.Volu // 3. Volume is not a DR volume AND // 4. Volume is not expanding AND // 5. Volume is not migrating AND -// 6. The current volume's engine image is compatible with the new engine image +// 6. Volume is not strict-local AND +// 7. The current volume's engine image is compatible with the new engine image func (ic *EngineImageController) canDoLiveEngineImageUpgrade(v *longhorn.Volume, newEngineImageResource *longhorn.EngineImage) bool { if v.Status.State != longhorn.VolumeStateAttached { return false @@ -532,6 +533,9 @@ func (ic *EngineImageController) canDoLiveEngineImageUpgrade(v *longhorn.Volume, if util.IsVolumeMigrating(v) { return false } + if v.Spec.DataLocality == longhorn.DataLocalityStrictLocal { + return false + } oldEngineImageResource, err := ic.ds.GetEngineImage(types.GetEngineImageChecksumName(v.Status.CurrentImage)) if err != nil { return false diff --git a/manager/volume.go b/manager/volume.go index 6933f2ded3..97b65dce0c 100644 --- a/manager/volume.go +++ b/manager/volume.go @@ -808,6 +808,10 @@ func (m *VolumeManager) EngineUpgrade(volumeName, image string) (v *longhorn.Vol return nil, fmt.Errorf("cannot do live upgrade for a unhealthy volume %v", v.Name) } + if v.Status.State == longhorn.VolumeStateAttached && v.Spec.DataLocality == longhorn.DataLocalityStrictLocal { + return nil, fmt.Errorf("cannot do live upgrade for an attached strict-local volume %v", v.Name) + } + oldImage := v.Spec.Image v.Spec.Image = image