Skip to content

Commit

Permalink
Limit backup job name to 63 chars, fix bitpoke#836
Browse files Browse the repository at this point in the history
  • Loading branch information
w33dw0r7d committed Aug 8, 2022
1 parent f0f34ba commit 54910b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/internal/mysqlbackup/mysqlbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ func (b *MysqlBackup) composeBackupURL(base string) string {

// GetNameForJob returns the name of the job
func (b *MysqlBackup) GetNameForJob() string {
return fmt.Sprintf("%s-backup", b.Name)
prefix := b.Name
if len(prefix) >= 56 {
prefix = fmt.Sprintf("%s-%d", prefix[:44], hash(prefix))
}
return fmt.Sprintf("%s-backup", prefix)
}

// GetNameForDeletionJob returns the name for the hard deletion job.
Expand Down

0 comments on commit 54910b8

Please sign in to comment.