Add engine version check when passing the backup-name flag
The flag `--backup-name` is available start from engine version 5.
Add version check when passing the backup-name flag.
Longhorn
@@ -273,7 +273,7 @@ func (e *Engine) SnapshotBackup(backupName, snapName, backupTarget, backingImage
args = append(args, "--backing-image-checksum", backingImageChecksum)
}
}
- if backupName != "" {
+ if backupName != "" && version.ClientVersion.CLIAPIVersion > CLIVersionFour {
args = append(args, "--backup-name", backupName)
}
for k, v := range labels {
