diff options
author | Paul Okstad <pokstad@gitlab.com> | 2020-10-03 02:13:48 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2020-10-06 18:21:07 +0300 |
commit | eb99e6f70d4e56abb4292a445825116dd804c65d (patch) | |
tree | dc33f05413653399a44a7522c0ec401124037083 /internal/testhelper | |
parent | 65cd98f93c072f3a536021462c56e686cb2f8c7b (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.go | 6 |
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, }, } |