diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-23 10:20:45 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-23 10:20:45 +0000 |
commit | bb9d360c0a7daed6aa08a0635e084c314c2c8b3e (patch) | |
tree | 2320d72d11cf226ff35ccc5f00c9e4cd8af5fee1 /config | |
parent | 963e445f58f1cbe03f821167a3bf1d0b8cc8a56d (diff) | |
parent | 008a6a6ce6fa943adcfecf3a606b845cfa282680 (diff) | |
download | gitlab-ce-bb9d360c0a7daed6aa08a0635e084c314c2c8b3e.tar.gz |
Merge branch 'mark-legacy-git-access' into 'master'
Route path lookups through legacy_disk_path
See merge request gitlab-org/gitlab-ce!17743
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 9 | ||||
-rw-r--r-- | config/initializers/6_validations.rb | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index ea0dee7af53..53cf0010d8e 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -467,12 +467,7 @@ unless Settings.repositories.storages['default'] end Settings.repositories.storages.each do |key, storage| - storage = Settingslogic.new(storage) - - # Expand relative paths - storage['path'] = Settings.absolute(storage['path']) - - Settings.repositories.storages[key] = storage + Settings.repositories.storages[key] = Gitlab::GitalyClient::StorageSettings.new(storage) end # @@ -486,7 +481,7 @@ repositories_storages = Settings.repositories.storages.values repository_downloads_path = Settings.gitlab['repository_downloads_path'].to_s.gsub(%r{/$}, '') repository_downloads_full_path = File.expand_path(repository_downloads_path, Settings.gitlab['user_home']) -if repository_downloads_path.blank? || repositories_storages.any? { |rs| [repository_downloads_path, repository_downloads_full_path].include?(rs['path'].gsub(%r{/$}, '')) } +if repository_downloads_path.blank? || repositories_storages.any? { |rs| [repository_downloads_path, repository_downloads_full_path].include?(rs.legacy_disk_path.gsub(%r{/$}, '')) } Settings.gitlab['repository_downloads_path'] = File.join(Settings.shared['path'], 'cache/archive') end diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb index f8e67ce04c9..d92cdb97766 100644 --- a/config/initializers/6_validations.rb +++ b/config/initializers/6_validations.rb @@ -5,7 +5,7 @@ end def find_parent_path(name, path) parent = Pathname.new(path).realpath.parent Gitlab.config.repositories.storages.detect do |n, rs| - name != n && Pathname.new(rs['path']).realpath == parent + name != n && Pathname.new(rs.legacy_disk_path).realpath == parent end rescue Errno::EIO, Errno::ENOENT => e warning = "WARNING: couldn't verify #{path} (#{name}). "\ @@ -33,7 +33,7 @@ def validate_storages_config "If you're using the Gitlab Development Kit, you can update your configuration running `gdk reconfigure`.\n" end - if !repository_storage.is_a?(Hash) || repository_storage['path'].nil? + if !repository_storage.is_a?(Gitlab::GitalyClient::StorageSettings) || repository_storage.legacy_disk_path.nil? storage_validation_error("#{name} is not a valid storage, because it has no `path` key. Refer to gitlab.yml.example for an updated example") end @@ -50,7 +50,7 @@ end def validate_storages_paths Gitlab.config.repositories.storages.each do |name, repository_storage| - parent_name, _parent_path = find_parent_path(name, repository_storage['path']) + parent_name, _parent_path = find_parent_path(name, repository_storage.legacy_disk_path) if parent_name storage_validation_error("#{name} is a nested path of #{parent_name}. Nested paths are not supported for repository storages") end |