From 94648e44f892c8482972a0bb3e76169758b16cd3 Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 25 Sep 2024 19:38:26 +0800 Subject: [PATCH] fix(tenantop): set owner references for op of new types --- api/v1alpha1/obtenantoperation_webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/obtenantoperation_webhook.go b/api/v1alpha1/obtenantoperation_webhook.go index 688ffa19e..994551f12 100644 --- a/api/v1alpha1/obtenantoperation_webhook.go +++ b/api/v1alpha1/obtenantoperation_webhook.go @@ -69,7 +69,7 @@ func (r *OBTenantOperation) Default() { } else if r.Spec.Type == constants.TenantOpSwitchover && r.Spec.Switchover != nil { targetTenantName = r.Spec.Switchover.PrimaryTenant secondaryTenantName = r.Spec.Switchover.StandbyTenant - } else if (r.Spec.Type == constants.TenantOpUpgrade || r.Spec.Type == constants.TenantOpReplayLog) && r.Spec.TargetTenant != nil { + } else if r.Spec.TargetTenant != nil { targetTenantName = *r.Spec.TargetTenant } references := r.GetOwnerReferences()