From 44ca7a6632aea33e2738bb89e5c9bc49e8dc9310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Blaise?= <32685572+clementblaise@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:42:03 +0200 Subject: [PATCH] Update request/request.go Co-authored-by: Nic Cope --- request/request.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/request/request.go b/request/request.go index 1ca7294..923c06d 100644 --- a/request/request.go +++ b/request/request.go @@ -138,11 +138,10 @@ func GetCredential(req *v1beta1.RunFunctionRequest, name string) (resource.Crede return resource.Credential{}, errors.Errorf("%s: credential not found", name) } - switch cred.GetSource().(type) { + switch t := cred.GetSource().(type) { case *v1beta1.Credentials_CredentialData: return resource.Credential{Data: cred.GetCredentialData().GetData()}, nil default: - sourceType := reflect.TypeOf(cred.GetSource()).String() - return resource.Credential{}, errors.Errorf("%s: not a supported credential source", sourceType) + return resource.Credential{}, errors.Errorf("%s: not a supported credential source", t) } }