Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(upgrade): fix upgrade issues from v1.7.x to v1.8.0 #3383

Merged
merged 2 commits into from
Dec 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions upgrade/v17xto180/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ func upgradeBackups(namespace string, lhClient *lhclientset.Clientset, resourceM
return errors.Wrapf(err, "failed to get volume %v of backup %v", b.Status.VolumeName, b.Name)
}
} else {
backupTargetName = vol.Spec.BackupTargetName
if vol.Spec.BackupTargetName != "" {
backupTargetName = vol.Spec.BackupTargetName
}
}
b.Labels = addLabel(b.Labels, types.LonghornLabelBackupTarget, backupTargetName)
}
Expand Down Expand Up @@ -215,14 +217,14 @@ func upgradeBackingImages(namespace string, lhClient *lhclientset.Clientset, res
}

// before v1.8.0, there should not have any v2 data engine disk in the backing image.
for bi.Spec.DiskFileSpecMap != nil {
if bi.Spec.DiskFileSpecMap != nil {
for diskUUID := range bi.Spec.DiskFileSpecMap {
bi.Spec.DiskFileSpecMap[diskUUID].DataEngine = longhorn.DataEngineTypeV1
}
}

// before v1.8.0, there should not have any v2 data engine disk in the backing image.
for bi.Status.DiskFileStatusMap != nil {
if bi.Status.DiskFileStatusMap != nil {
for diskUUID := range bi.Status.DiskFileStatusMap {
bi.Status.DiskFileStatusMap[diskUUID].DataEngine = longhorn.DataEngineTypeV1
}
Expand Down
Loading