From b948c4c3eb7acdd7decd174667a8e9fd935169a7 Mon Sep 17 00:00:00 2001 From: Imtiaz Uddin <59226374+Imtiaz246@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:44:54 +0600 Subject: [PATCH] Fix resource-calculator edit bug (#270) Signed-off-by: Imtiaz Uddin --- pkg/registry/meta/resourcecalculator/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/registry/meta/resourcecalculator/storage.go b/pkg/registry/meta/resourcecalculator/storage.go index 70220101a..bfc1526e9 100644 --- a/pkg/registry/meta/resourcecalculator/storage.go +++ b/pkg/registry/meta/resourcecalculator/storage.go @@ -109,7 +109,7 @@ func (r *Storage) Create(ctx context.Context, obj runtime.Object, createValidati if err = wrapReferencedDBResourceWithOpsReqObject(r.kc, &u); err != nil { return nil, err } - } else if in.Request.Edit { + } else if in.Request.Edit && pq != nil { if err := deductOldDbObjectResourceUsageFromProjectQuota(r.kc, u, pq); err != nil { return nil, err }