Skip to content

Commit

Permalink
Merge branch 'main' into K8SPXC-1446-revert-1160
Browse files Browse the repository at this point in the history
  • Loading branch information
eleo007 authored Dec 23, 2024
2 parents 16fbe8e + 0757fb4 commit daf3f9d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/naming/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,22 @@ func trimJobName(name string) string {
}

func ScheduledBackupName(crName, storageName, schedule string) string {
result := "cron-"
result := "cron"

if len(crName) > 16 {
result += crName[:16]
result += "-" + crName[:16]
} else {
result += crName
result += "-" + crName
}

if len(storageName) > 16 {
result += storageName[:16]
result += "-" + storageName[:16]
} else {
result += storageName
result += "-" + storageName
}

result += "-" + storageName + "-"
tnow := time.Now()
result += fmt.Sprintf("%d%d%d%d%d%d", tnow.Year(), tnow.Month(), tnow.Day(), tnow.Hour(), tnow.Minute(), tnow.Second())
result += "-" + fmt.Sprintf("%d%d%d%d%d%d", tnow.Year(), tnow.Month(), tnow.Day(), tnow.Hour(), tnow.Minute(), tnow.Second())
result += "-" + strconv.FormatUint(uint64(crc32.ChecksumIEEE([]byte(schedule))), 32)[:5]
return result
}

0 comments on commit daf3f9d

Please sign in to comment.