Skip to content

Commit

Permalink
Update request/request.go
Browse files Browse the repository at this point in the history
Co-authored-by: Nic Cope <[email protected]>
  • Loading branch information
clementblaise and negz authored Jun 3, 2024
1 parent 0a91475 commit 44ca7a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 44ca7a6

Please sign in to comment.