Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2020-10-03 02:13:48 +0300
committerPaul Okstad <pokstad@gitlab.com>2020-10-06 18:21:07 +0300
commiteb99e6f70d4e56abb4292a445825116dd804c65d (patch)
treedc33f05413653399a44a7522c0ec401124037083 /internal/testhelper
parent65cd98f93c072f3a536021462c56e686cb2f8c7b (diff)
Refactor server metadata to be more type safe
Prevents improper access to dynamic map keys by unmarshalling the schema to stricter struct with fields. Part of https://gitlab.com/gitlab-org/gitaly/-/issues/3061
Diffstat (limited to 'internal/testhelper')
-rw-r--r--internal/testhelper/testhelper.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go
index 134367ead..8a11b8c28 100644
--- a/internal/testhelper/testhelper.go
+++ b/internal/testhelper/testhelper.go
@@ -133,9 +133,9 @@ func GitlabTestStoragePath() string {
// inter-gitaly operations.
func GitalyServersMetadata(t testing.TB, serverSocketPath string) metadata.MD {
gitalyServers := storage.GitalyServers{
- "default": {
- "address": serverSocketPath,
- "token": RepositoryAuthToken,
+ "default": storage.ServerInfo{
+ Address: serverSocketPath,
+ Token: RepositoryAuthToken,
},
}