From a56e2f3fc1538e2df51bc48ef0221b22e5c58f2a Mon Sep 17 00:00:00 2001 From: Tiago Carreira Date: Wed, 18 May 2022 10:39:25 -0300 Subject: [PATCH] test for nullable object --- internal/pkg/rpaas/certificates.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/pkg/rpaas/certificates.go b/internal/pkg/rpaas/certificates.go index a05709da0..ed352c73f 100644 --- a/internal/pkg/rpaas/certificates.go +++ b/internal/pkg/rpaas/certificates.go @@ -161,7 +161,11 @@ func (m *k8sRpaasManager) getCustomIssuerMetadata(ctx context.Context, namespace name, kind, group := parts[0], parts[1], parts[2] - mapping, err := m.cli.RESTMapper().RESTMapping(schema.GroupKind{Group: group, Kind: kind}) + restMapper := m.cli.RESTMapper() + if restMapper == nil { + return map[string]string{}, nil + } + mapping, err := restMapper.RESTMapping(schema.GroupKind{Group: group, Kind: kind}) if err != nil { return nil, err }