Commit 5ee78a3e authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 0c4d4988 ab06c9b6
...@@ -50,7 +50,7 @@ module Clusters ...@@ -50,7 +50,7 @@ module Clusters
validates :name, cluster_name: true validates :name, cluster_name: true
validates :cluster_type, presence: true validates :cluster_type, presence: true
validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true, require_valid_tld: true } validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
validate :restrict_modification, on: :update validate :restrict_modification, on: :update
validate :no_groups, unless: :group_type? validate :no_groups, unless: :group_type?
......
...@@ -12,9 +12,6 @@ class MergeRequestDiff < ActiveRecord::Base ...@@ -12,9 +12,6 @@ class MergeRequestDiff < ActiveRecord::Base
# Don't display more than 100 commits at once # Don't display more than 100 commits at once
COMMITS_SAFE_SIZE = 100 COMMITS_SAFE_SIZE = 100
ignore_column :st_commits,
:st_diffs
belongs_to :merge_request belongs_to :merge_request
manual_inverse_association :merge_request, :merge_request_diff manual_inverse_association :merge_request, :merge_request_diff
......
---
title: Fixes incorrect TLD validation errors for Kubernetes cluster domain
merge_request: 25262
author:
type: fixed
...@@ -2,19 +2,6 @@ class LimitsToMysql < ActiveRecord::Migration[4.2] ...@@ -2,19 +2,6 @@ class LimitsToMysql < ActiveRecord::Migration[4.2]
def up def up
return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
# These columns were removed in 10.3, but this is called from two places:
# 1. A migration run after they were added, but before they were removed.
# 2. A rake task which can be run at any time.
#
# Because of item 2, we need these checks.
if column_exists?(:merge_request_diffs, :st_commits)
change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647
end
if column_exists?(:merge_request_diffs, :st_diffs)
change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647
end
change_column :snippets, :content, :text, limit: 2147483647 change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647 change_column :notes, :st_diff, :text, limit: 2147483647
end end
......
...@@ -146,7 +146,6 @@ excluded_attributes: ...@@ -146,7 +146,6 @@ excluded_attributes:
- :external_diff - :external_diff
- :stored_externally - :stored_externally
- :external_diff_store - :external_diff_store
- :st_diffs
merge_request_diff_files: merge_request_diff_files:
- :diff - :diff
- :external_diff_offset - :external_diff_offset
......
...@@ -453,7 +453,7 @@ describe Groups::ClustersController do ...@@ -453,7 +453,7 @@ describe Groups::ClustersController do
end end
context 'when domain is invalid' do context 'when domain is invalid' do
let(:domain) { 'not-a-valid-domain' } let(:domain) { 'http://not-a-valid-domain' }
it 'should not update cluster attributes' do it 'should not update cluster attributes' do
go go
......
...@@ -265,12 +265,12 @@ describe Clusters::Cluster do ...@@ -265,12 +265,12 @@ describe Clusters::Cluster do
it { is_expected.to be_valid } it { is_expected.to be_valid }
end end
context 'when cluster has an invalid domain' do context 'when cluster is not a valid hostname' do
let(:cluster) { build(:cluster, domain: 'not-valid-domain') } let(:cluster) { build(:cluster, domain: 'http://not.a.valid.hostname') }
it 'should add an error on domain' do it 'should add an error on domain' do
expect(subject).not_to be_valid expect(subject).not_to be_valid
expect(subject.errors[:domain].first).to eq('is not a fully qualified domain name') expect(subject.errors[:domain].first).to eq('contains invalid characters (valid characters: [a-z0-9\\-])')
end end
end end
......
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