Make a default namespace of Kubernetes service to contain project ID
This commit is contained in:
parent
348dff0a82
commit
6fa106b898
|
@ -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
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Make a default namespace of Kubernetes service to contain project ID
|
||||
merge_request:
|
||||
author:
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue