gitlab-org--gitlab-foss/config/initializers/6_validations.rb
Zeger-Jan van de Weg cb4a514207
Remove ignored circuit_breaker columns
The circuit breaker itself got removed a while ago, when that happened
some parts got left behind. Using grep old stale settings and
validations were found and are now removed.
2019-06-28 10:30:40 +02:00

17 lines
497 B
Ruby

def storage_validation_error(message)
raise "#{message}. Please fix this in your gitlab.yml before starting GitLab."
end
def validate_storages_config
if Gitlab.config.repositories.storages.empty?
storage_validation_error('No repository storage path defined')
end
Gitlab.config.repositories.storages.keys.each do |name|
unless /\A[a-zA-Z0-9\-_]+\z/.match?(name)
storage_validation_error("\"#{name}\" is not a valid storage name")
end
end
end
validate_storages_config