Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3016a2a3
Commit
3016a2a3
authored
Feb 14, 2019
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove TLD validation from Cluster#domain
parent
482b91d5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+1
-1
changelogs/unreleased/57650-remove-tld-validation-from-cluster.yml
...s/unreleased/57650-remove-tld-validation-from-cluster.yml
+5
-0
spec/controllers/groups/clusters_controller_spec.rb
spec/controllers/groups/clusters_controller_spec.rb
+1
-1
spec/models/clusters/cluster_spec.rb
spec/models/clusters/cluster_spec.rb
+3
-3
No files found.
app/models/clusters/cluster.rb
View file @
3016a2a3
...
...
@@ -50,7 +50,7 @@ module Clusters
validates
:name
,
cluster_name:
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
:no_groups
,
unless: :group_type?
...
...
changelogs/unreleased/57650-remove-tld-validation-from-cluster.yml
0 → 100644
View file @
3016a2a3
---
title
:
Fixes incorrect TLD validation errors for Kubernetes cluster domain
merge_request
:
25262
author
:
type
:
fixed
spec/controllers/groups/clusters_controller_spec.rb
View file @
3016a2a3
...
...
@@ -453,7 +453,7 @@ describe Groups::ClustersController do
end
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
go
...
...
spec/models/clusters/cluster_spec.rb
View file @
3016a2a3
...
...
@@ -265,12 +265,12 @@ describe Clusters::Cluster do
it
{
is_expected
.
to
be_valid
}
end
context
'when cluster
has an invalid domain
'
do
let
(
:cluster
)
{
build
(
:cluster
,
domain:
'
not-valid-domain
'
)
}
context
'when cluster
is not a valid hostname
'
do
let
(
:cluster
)
{
build
(
:cluster
,
domain:
'
http://not.a.valid.hostname
'
)
}
it
'should add an error on domain'
do
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment