From 7bb75d798cdbd3b983c3c3d57fab9d02907c4d06 Mon Sep 17 00:00:00 2001 From: Allan Reid Date: Wed, 11 Jan 2023 13:10:32 -0800 Subject: [PATCH] Simplified NPE check on RuntimeClassName --- operatorapi/tenants.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/operatorapi/tenants.go b/operatorapi/tenants.go index d98451075b..9112cf6582 100644 --- a/operatorapi/tenants.go +++ b/operatorapi/tenants.go @@ -2494,11 +2494,9 @@ func parseTenantPool(pool *miniov2.Pool) *models.Pool { } } - runtimeClassNameValue := "" - runtimeClassName := &runtimeClassNameValue - + var runtimeClassName string if pool.RuntimeClassName != nil { - runtimeClassName = pool.RuntimeClassName + runtimeClassName = *pool.RuntimeClassName } poolModel := &models.Pool{ @@ -2514,7 +2512,7 @@ func parseTenantPool(pool *miniov2.Pool) *models.Pool { Affinity: affinity, Tolerations: tolerations, SecurityContext: &securityContext, - RuntimeClassName: *runtimeClassName, + RuntimeClassName: runtimeClassName, } return poolModel }