Class: ContainerConfig::Provider::SecretVolume
- Defined in:
- lib/container_config/provider/secret_volume.rb
Overview
Secret volume mount config value provider
Constant Summary collapse
- DEFAULT_SECRET_PATH =
Default secret volume mount path used when globbing secret files
"/etc/*-secrets"
Instance Attribute Summary collapse
-
#default_directory ⇒ Object
Returns the value of attribute default_directory.
-
#directory ⇒ Object
Returns the value of attribute directory.
Instance Method Summary collapse
-
#initialize ⇒ SecretVolume
constructor
Initializes a new ContainerConfig::Provider::SecretVolume.
-
#load(key, *dig_keys, **options) ⇒ Object
Loads a secret volume mount configuration setting.
- #name ⇒ Object
Constructor Details
#initialize ⇒ SecretVolume
Initializes a new ContainerConfig::Provider::SecretVolume
22 23 24 25 26 |
# File 'lib/container_config/provider/secret_volume.rb', line 22 def initialize super @default_directory = DEFAULT_SECRET_PATH @directory = nil end |
Instance Attribute Details
#default_directory ⇒ Object
Returns the value of attribute default_directory.
12 13 14 |
# File 'lib/container_config/provider/secret_volume.rb', line 12 def default_directory @default_directory end |
#directory ⇒ Object
Returns the value of attribute directory.
12 13 14 |
# File 'lib/container_config/provider/secret_volume.rb', line 12 def directory @directory end |
Instance Method Details
#load(key, *dig_keys, **options) ⇒ Object
Loads a secret volume mount configuration setting
40 41 42 43 44 45 46 |
# File 'lib/container_config/provider/secret_volume.rb', line 40 def load(key, *dig_keys, **) super secret_file = Dir.glob(File.join(secret_mount_directory(**), "**", key)).first return if secret_file.nil? || !File.exist?(secret_file) File.read(secret_file) end |
#name ⇒ Object
15 16 17 |
# File 'lib/container_config/provider/secret_volume.rb', line 15 def name "Secret Volume" end |