fix: make instance ID required field

This commit is contained in:
garethgeorge
2024-07-01 21:05:50 -07:00
parent 90e0656fc4
commit 7c8ded2fcc
5 changed files with 42 additions and 59 deletions

View File

@@ -191,7 +191,11 @@ func planForSnapshot(snapshot *v1.ResticSnapshot) string {
}
func instanceIDForSnapshot(snapshot *v1.ResticSnapshot) string {
return repo.InstanceIDFromTags(snapshot.Tags)
id := repo.InstanceIDFromTags(snapshot.Tags)
if id != "" {
return id
}
return InstanceIDForUnassociatedOperations
}
// tryMigrate checks if the snapshots use the latest backrest tag set and migrates them if necessary.