From 1b4080b3a0f5f562e4cb67aa9c401d30415ada96 Mon Sep 17 00:00:00 2001 From: amecea Date: Mon, 31 Aug 2020 19:32:12 +0300 Subject: [PATCH] Limit cleanup job name to 63 chars, fixes #577 --- pkg/internal/mysqlbackup/mysqlbackup.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/internal/mysqlbackup/mysqlbackup.go b/pkg/internal/mysqlbackup/mysqlbackup.go index 989daccbb..19c83ff11 100644 --- a/pkg/internal/mysqlbackup/mysqlbackup.go +++ b/pkg/internal/mysqlbackup/mysqlbackup.go @@ -83,7 +83,11 @@ func (b *MysqlBackup) GetNameForJob() string { // GetNameForDeletionJob returns the name for the hard deletion job. func (b *MysqlBackup) GetNameForDeletionJob() string { - return fmt.Sprintf("%s-backup-cleanup", b.Name) + prefix := b.Name + if len(prefix) >= 55 { + prefix = prefix[:55] + } + return fmt.Sprintf("%s-cleanup", prefix) } // String returns the backup name and namespace