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
Léo-Paul Géneau
gitlab-ce
Commits
6fa106b8
Commit
6fa106b8
authored
Mar 06, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a default namespace of Kubernetes service to contain project ID
parent
348dff0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
app/models/project_services/kubernetes_service.rb
app/models/project_services/kubernetes_service.rb
+1
-1
changelogs/unreleased/28516-default-kubernetes-namespace.yml
changelogs/unreleased/28516-default-kubernetes-namespace.yml
+4
-0
spec/models/project_services/kubernetes_service_spec.rb
spec/models/project_services/kubernetes_service_spec.rb
+4
-2
No files found.
app/models/project_services/kubernetes_service.rb
View file @
6fa106b8
...
...
@@ -36,7 +36,7 @@ class KubernetesService < DeploymentService
def
initialize_properties
if
properties
.
nil?
self
.
properties
=
{}
self
.
namespace
=
project
.
path
if
project
.
present?
self
.
namespace
=
"
#{
project
.
path
}
-
#{
project
.
id
}
"
if
project
.
present?
end
end
...
...
changelogs/unreleased/28516-default-kubernetes-namespace.yml
0 → 100644
View file @
6fa106b8
---
title
:
Make a default namespace of Kubernetes service to contain project ID
merge_request
:
author
:
spec/models/project_services/kubernetes_service_spec.rb
View file @
6fa106b8
...
...
@@ -74,8 +74,10 @@ describe KubernetesService, models: true, caching: true do
describe
'#initialize_properties'
do
context
'with a project'
do
it
'defaults to the project name'
do
expect
(
described_class
.
new
(
project:
project
).
namespace
).
to
eq
(
project
.
name
)
let
(
:namespace_name
)
{
"
#{
project
.
path
}
-
#{
project
.
id
}
"
}
it
'defaults to the project name with ID'
do
expect
(
described_class
.
new
(
project:
project
).
namespace
).
to
eq
(
namespace_name
)
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