Commit 89038aca authored by Krasimir Angelov's avatar Krasimir Angelov
parent 3a355bb3
...@@ -31,8 +31,8 @@ module Gitlab ...@@ -31,8 +31,8 @@ module Gitlab
engine: { engine: {
name: 'kv-v2', path: secret[:engine_path] name: 'kv-v2', path: secret[:engine_path]
}, },
path: secret[:path], path: secret[:secret_path],
field: secret[:field] field: secret[:secret_field]
} }
end end
...@@ -40,21 +40,27 @@ module Gitlab ...@@ -40,21 +40,27 @@ module Gitlab
def secret def secret
@secret ||= begin @secret ||= begin
path_and_field, _, engine_path = config.rpartition('@') secret, engine_path = secret_and_engine
if path_and_field == "" secret_path, _, secret_field = secret.rpartition('/')
path_and_field = config
engine_path = 'kv-v2'
end
path, _, field = path_and_field.rpartition('/')
{ {
engine_path: engine_path, engine_path: engine_path,
path: path, secret_path: secret_path,
field: field secret_field: secret_field
} }
end end
end end
def secret_and_engine
secret, _, engine = config.rpartition('@')
if secret == ""
secret = config
engine = 'kv-v2'
end
[secret, engine]
end
end end
class HashStrategy < ::Gitlab::Config::Entry::Node class HashStrategy < ::Gitlab::Config::Entry::Node
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment