File size: 1,502 Bytes
d61821a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | diff --git a/cache/adapter.go b/cache/adapter.go
index ff913cd3..6780fd5a 100644
--- a/cache/adapter.go
+++ b/cache/adapter.go
@@ -3,8 +3,11 @@ package cache
import (
"context"
"fmt"
+ "maps"
"net/http"
"net/url"
+ "slices"
+ "strings"
"sync"
"time"
@@ -63,7 +66,11 @@ func (m *FactoriesMap) Find(typeName string) (Factory, error) {
factory := m.internal[typeName]
if factory == nil {
- return nil, fmt.Errorf("factory for cache adapter %q was not registered", typeName)
+ return nil, fmt.Errorf(
+ "factory for cache adapter %q was not registered (registered adapters: %s)",
+ typeName,
+ strings.Join(slices.Sorted(maps.Keys(m.internal)), ", "),
+ )
}
return factory, nil
diff --git a/cache/credentials_adapter.go b/cache/credentials_adapter.go
index b64f984b..32a97828 100644
--- a/cache/credentials_adapter.go
+++ b/cache/credentials_adapter.go
@@ -2,6 +2,9 @@ package cache
import (
"fmt"
+ "maps"
+ "slices"
+ "strings"
"sync"
"gitlab.com/gitlab-org/gitlab-runner/cache/cacheconfig"
@@ -48,7 +51,11 @@ func (m *CredentialsFactoriesMap) Find(typeName string) (CredentialsFactory, err
factory := m.internal[typeName]
if factory == nil {
- return nil, fmt.Errorf("factory for credentials adapter %q not registered", typeName)
+ return nil, fmt.Errorf(
+ "factory for credentials adapter %q not registered (registered adapters: %s)",
+ typeName,
+ strings.Join(slices.Sorted(maps.Keys(m.internal)), ", "),
+ )
}
return factory, nil
|