提交 db2617fd 编写于 作者: S Sean McGivern

Merge branch 'default-kubernetes-namespace' into 'master'

Make a default namespace of Kubernetes service to contain project ID

Closes #28516

See merge request !9741
......@@ -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
......
---
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册