diff options
author | Tiger <twatson@gitlab.com> | 2019-03-13 14:06:54 +1100 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-03-20 12:04:46 +1100 |
commit | 89b0bc04b9927abc85ce5fc3735438f956a8d5a2 (patch) | |
tree | 29355d49ce1a784b4695b4897880c6fe2879d353 /app | |
parent | 759dab5b69f53a861045ebbc84836f83c7502af2 (diff) | |
download | gitlab-ce-89b0bc04b9927abc85ce5fc3735438f956a8d5a2.tar.gz |
Create one Kubernetes namespace for a deployment
Instead of creating a Kubernetes namespace on every
cluster related to a project, only create one on the
cluster the project is about to be deployed to.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/deployment.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 811e623b7f7..428edfd88de 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -78,6 +78,10 @@ class Deployment < ActiveRecord::Base Commit.truncate_sha(sha) end + def cluster + project.deployment_platform(environment: environment.name)&.cluster + end + def last? self == environment.last_deployment end |