Fix upgrade failure from v1.1.x or below
volume.Spec.ReplicaAutoBalance is introduced from v1.2.x.
The empty string of volume.Spec.ReplicaAutoBalance while upgrading from v1.1.x or below
cannot pass the v1beta2 CRD validation of, so initialize  volume.Spec.ReplicaAutoBalance
with empty string to "ignored".
Longhorn 3265
@@ -94,6 +94,9 @@ func fixupVolumes(namespace string, lhClient *lhclientset.Clientset) error {
for _, obj := range volumes.Items {
existing := obj.DeepCopy()
+ if obj.Spec.ReplicaAutoBalance == "" {
+ obj.Spec.ReplicaAutoBalance = longhornV1beta1.ReplicaAutoBalanceIgnored
+ }
if obj.Spec.DiskSelector == nil {
obj.Spec.DiskSelector = []string{}
}
