diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-06-27 19:20:03 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-06-27 19:20:03 +0300 |
commit | 1142e2c32eb0c4f4040c13d40d73fb8f84f35628 (patch) | |
tree | 512a0ed100c24e1376c6457e248b1922e4a3f359 /config/initializers/6_validations.rb | |
parent | 4f7dce769559f0fca2448e25417e5fef2b51df06 (diff) |
Migrate storage nesting check to Gitaly
Diffstat (limited to 'config/initializers/6_validations.rb')
-rw-r--r-- | config/initializers/6_validations.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb index ff6865608f0..bf9e5a50382 100644 --- a/config/initializers/6_validations.rb +++ b/config/initializers/6_validations.rb @@ -2,20 +2,6 @@ def storage_name_valid?(name) !!(name =~ /\A[a-zA-Z0-9\-_]+\z/) 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.legacy_disk_path).realpath == parent - end -rescue Errno::EIO, Errno::ENOENT => e - warning = "WARNING: couldn't verify #{path} (#{name}). "\ - "If this is an external storage, it might be offline." - message = "#{warning}\n#{e.message}" - Rails.logger.error("#{message}\n\t" + e.backtrace.join("\n\t")) - - nil -end - def storage_validation_error(message) raise "#{message}. Please fix this in your gitlab.yml before starting GitLab." end @@ -37,17 +23,4 @@ def validate_storages_config end end -# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1237 -def validate_storages_paths - Gitlab::GitalyClient::StorageSettings.allow_disk_access do - Gitlab.config.repositories.storages.each do |name, repository_storage| - 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 - end - end -end - validate_storages_config -validate_storages_paths unless Rails.env.test? || ENV['SKIP_STORAGE_VALIDATION'] == 'true' |