Class: OnContainer::Secrets::MountedFiles::EnvLoader
- Inherits:
-
Object
- Object
- OnContainer::Secrets::MountedFiles::EnvLoader
- Includes:
- Common::SafePerformable
- Defined in:
- lib/on_container/secrets/mounted_files/env_loader.rb
Instance Method Summary collapse
- #perform! ⇒ Object
- #secret_mounted_file_paths ⇒ Object (also: #scan_secrets_path_for_files)
- #secrets_path ⇒ Object (also: #setup_secrets_path)
Methods included from Common::SafePerformable
Instance Method Details
#perform! ⇒ Object
13 14 15 16 17 |
# File 'lib/on_container/secrets/mounted_files/env_loader.rb', line 13 def perform! setup_secrets_path scan_secrets_path_for_files load_secret_files_to_env_vars end |
#secret_mounted_file_paths ⇒ Object Also known as: scan_secrets_path_for_files
23 24 25 26 27 |
# File 'lib/on_container/secrets/mounted_files/env_loader.rb', line 23 def secret_mounted_file_paths @secret_mounted_file_paths ||= Dir["#{secrets_path}/**/*"] .map { |path| Pathname.new(path) } .select(&:file?) end |
#secrets_path ⇒ Object Also known as: setup_secrets_path
19 20 21 |
# File 'lib/on_container/secrets/mounted_files/env_loader.rb', line 19 def secrets_path @secrets_path ||= ENV.fetch('SECRETS_PATH', '/run/secrets') end |