Class: Gitlab::Kubernetes::Helm::Pod
- Inherits:
-
Object
- Object
- Gitlab::Kubernetes::Helm::Pod
- Defined in:
- lib/gitlab/kubernetes/helm/pod.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(command, namespace_name, service_account_name: nil) ⇒ Pod
constructor
A new instance of Pod.
Constructor Details
#initialize(command, namespace_name, service_account_name: nil) ⇒ Pod
Returns a new instance of Pod.
7 8 9 10 11 |
# File 'lib/gitlab/kubernetes/helm/pod.rb', line 7 def initialize(command, namespace_name, service_account_name: nil) @command = command @namespace_name = namespace_name @service_account_name = service_account_name end |
Instance Method Details
#generate ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/gitlab/kubernetes/helm/pod.rb', line 13 def generate spec = { containers: [container_specification], restartPolicy: 'Never' } spec[:volumes] = volumes_specification spec[:containers][0][:volumeMounts] = volume_mounts_specification spec[:serviceAccountName] = service_account_name if service_account_name ::Kubeclient::Resource.new(metadata: , spec: spec) end |