Skip to content

Commit

Permalink
fix db backup named
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Aug 9, 2024
1 parent 802c058 commit e3d2424
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/pkg/resources/named.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ func NewResourceNamed(cr client.Object) *ResourceNamed {
labels := cr.GetLabels()
p := &ResourceNamed{labels: labels}
switch {
case cr.GetName() == KubeBlocksBackUpName || labels[dataProtectionBackupRepoKey] != "":
p._type = DBBackup
p._name = KubeBlocksBackUpName
if labels[InstanceLabelKey] != "" {
p._name = labels[InstanceLabelKey]
}
case labels[DBPodLabelComponentNameKey] != "":
p._type = DB
p._name = labels[DBPodLabelInstanceKey]
Expand All @@ -87,12 +93,6 @@ func NewResourceNamed(cr client.Object) *ResourceNamed {
case labels[ACMEChallengeKey] != "":
p._type = APP
p._name = getACMEResolverName(cr)
case cr.GetName() == KubeBlocksBackUpName || labels[dataProtectionBackupRepoKey] != "":
p._type = DBBackup
p._name = KubeBlocksBackUpName
if labels[InstanceLabelKey] != "" {
p._name = labels[InstanceLabelKey]
}
default:
p._type = OTHER
p._name = ""
Expand Down

0 comments on commit e3d2424

Please sign in to comment.