Class: CDK8sPlus25::K8S::ExecAction

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
k8_s/exec_action.rb

Overview

ExecAction describes a "run in container" action.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command: nil) ⇒ ExecAction

Returns a new instance of ExecAction.

Parameters:

  • command (Array<String>, nil) (defaults to: nil)

    Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem.



8
9
10
11
# File 'k8_s/exec_action.rb', line 8

def initialize(command: nil)
  @command = command
  Jsii::Type.check_type(@command, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=", "command") unless @command.nil?
end

Instance Attribute Details

#commandArray<String>? (readonly)

Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem.

The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.

Returns:

  • (Array<String>, nil)


18
19
20
# File 'k8_s/exec_action.rb', line 18

def command
  @command
end

Class Method Details

.jsii_propertiesObject



20
21
22
23
24
# File 'k8_s/exec_action.rb', line 20

def self.jsii_properties
  {
    :command => "command",
  }
end

Instance Method Details

#to_jsiiObject



26
27
28
29
30
31
32
# File 'k8_s/exec_action.rb', line 26

def to_jsii
  result = {}
  result.merge!({
    "command" => @command,
  })
  result.compact
end