Skip to content

Commit

Permalink
PB-6115 Handling label validation for Data Export CR
Browse files Browse the repository at this point in the history
- if the StorageClass name has more than 63 characters we fail to deploy the corresponding pod
- use annotation for storing SC name in DataExport CR

Signed-off-by: Vikas Kumar <[email protected]>
  • Loading branch information
vikasit12 committed Mar 18, 2024
1 parent 9e14fa6 commit fde4888
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/volume/kdmp/kdmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (k *kdmp) StartBackup(backup *storkapi.ApplicationBackup,
labels[utils.ApplicationBackupCRUIDKey] = utils.GetValidLabel(utils.GetShortUID(string(backup.UID)))
labels[pvcNameKey] = utils.GetValidLabel(pvc.Name)
labels[pvcUIDKey] = utils.GetValidLabel(utils.GetShortUID(string(pvc.UID)))
labels[kdmpStorageClassKey] = volumeInfo.StorageClass
labels[kdmpStorageClassKey] = utils.GetValidLabel(volumeInfo.StorageClass)
// If backup from px-backup, update the backup object details in the label
if val, ok := backup.Annotations[utils.PxbackupAnnotationCreateByKey]; ok {
if val == utils.PxbackupAnnotationCreateByValue {
Expand All @@ -283,6 +283,7 @@ func (k *kdmp) StartBackup(backup *storkapi.ApplicationBackup,
dataExport.Annotations[utils.SkipResourceAnnotation] = "true"
dataExport.Annotations[utils.BackupObjectUIDKey] = string(backup.Annotations[utils.PxbackupObjectUIDKey])
dataExport.Annotations[pvcUIDKey] = string(pvc.UID)
dataExport.Annotations[kdmpStorageClassKey] = volumeInfo.StorageClass
dataExport.Name = getGenericCRName(utils.PrefixBackup, string(backup.UID), string(pvc.UID), pvc.Namespace)
dataExport.Namespace = pvc.Namespace
dataExport.Spec.Type = kdmpapi.DataExportKopia
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fde4888

Please sign in to comment.