From c6e2349e024ffb0aa62a5e2f77b1e901a6c0b6a9 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 20 Dec 2024 14:49:13 +0800 Subject: [PATCH] fix(tenant): added deletion protection field to tenant --- internal/dashboard/business/oceanbase/obtenant.go | 1 + internal/dashboard/model/response/obtenant.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/dashboard/business/oceanbase/obtenant.go b/internal/dashboard/business/oceanbase/obtenant.go index 4dc6f1ae0..188a8a3e5 100644 --- a/internal/dashboard/business/oceanbase/obtenant.go +++ b/internal/dashboard/business/oceanbase/obtenant.go @@ -211,6 +211,7 @@ func buildOverviewFromApiType(t *v1alpha1.OBTenant) *response.OBTenantOverview { rt.Charset = t.Spec.Charset rt.Locality = t.Status.TenantRecordInfo.Locality rt.PrimaryZone = t.Status.TenantRecordInfo.PrimaryZone + rt.DeletionProtection = t.Annotations[oceanbaseconst.AnnotationsIgnoreDeletion] == "true" for i := range t.Status.Pools { pool := t.Status.Pools[i] diff --git a/internal/dashboard/model/response/obtenant.go b/internal/dashboard/model/response/obtenant.go index 2f8224148..29daf3417 100644 --- a/internal/dashboard/model/response/obtenant.go +++ b/internal/dashboard/model/response/obtenant.go @@ -27,6 +27,8 @@ type OBTenantOverview struct { Locality string `json:"locality" binding:"required"` // Locality of the tenant units Charset string `json:"charset" binding:"required"` // Charset of the tenant PrimaryZone string `json:"primaryZone" binding:"required"` // Primary zone of the tenant + + DeletionProtection bool `json:"deletionProtection" binding:"required"` // Whether the tenant is protected from deletion } type OBTenantDetail struct {