summaryrefslogtreecommitdiff
path: root/lib/gitlab/kubernetes/helm/pod.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/kubernetes/helm/pod.rb')
-rw-r--r--lib/gitlab/kubernetes/helm/pod.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/kubernetes/helm/pod.rb b/lib/gitlab/kubernetes/helm/pod.rb
index 6e5d3388405..95192b11c0d 100644
--- a/lib/gitlab/kubernetes/helm/pod.rb
+++ b/lib/gitlab/kubernetes/helm/pod.rb
@@ -2,9 +2,10 @@ module Gitlab
module Kubernetes
module Helm
class Pod
- def initialize(command, namespace_name)
+ def initialize(command, namespace_name, service_account_name: nil)
@command = command
@namespace_name = namespace_name
+ @service_account_name = service_account_name
end
def generate
@@ -12,13 +13,14 @@ module Gitlab
spec[:volumes] = volumes_specification
spec[:containers][0][:volumeMounts] = volume_mounts_specification
+ spec[:serviceAccountName] = service_account_name if service_account_name
::Kubeclient::Resource.new(metadata: metadata, spec: spec)
end
private
- attr_reader :command, :namespace_name, :kubeclient, :config_map
+ attr_reader :command, :namespace_name, :service_account_name
def container_specification
{