lib/metatron/templates/container.rb in metatron-0.3.1 vs lib/metatron/templates/container.rb in metatron-0.3.2
- old
+ new
@@ -4,17 +4,19 @@
module Templates
# Template for containers used by k8s resources (not an actual resource)
class Container
attr_accessor :name, :image, :command, :args, :env, :envfrom, :resources, :volume_mounts,
:image_pull_policy, :lifecycle, :probes, :security_context, :ports,
- :stdin, :tty
+ :stdin, :tty, :termination_message_path, :termination_message_policy
alias imagePullPolicy image_pull_policy
alias volumeMounts volume_mounts
alias securityContext security_context
alias environment env
alias envFrom envfrom
+ alias terminationMessagePath termination_message_path
+ alias terminationMessagePolicy termination_message_policy
def initialize(name, image = "gcr.io/google_containers/pause")
@name = name
@image = image
@command = nil
@@ -25,19 +27,23 @@
@image_pull_policy = "IfNotPresent"
@lifecycle = {}
@probes = {}
@stdin = true
@tty = true
+ @termination_message_path = nil
+ @termination_message_policy = nil
end
def render # rubocop:disable Metrics/AbcSize
{
name:,
command:,
image:,
imagePullPolicy:,
stdin:,
- tty:
+ tty:,
+ terminationMessagePath:,
+ terminationMessagePolicy:
}.merge(probes)
.merge(formatted_resources)
.merge(formatted_environment)
.merge(formatted_envfrom)
.merge(formatted_ports)