Class: ContainerConfig::Provider::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/container_config/provider/base.rb

Overview

Base config value provider

Direct Known Subclasses

Default, Env, RailsCredential, SecretVolume

Instance Method Summary collapse

Instance Method Details

#load(key, *_dig_keys, **options) ⇒ Object

Loads a configuration setting from the provider

Parameters:

  • key (String)

    Configuration key to load

  • _dig_keys (Array)

    Variable keys to use to load from providers that accept a dig structure defaults to the lowercase key split by underscores “MY_PASSWORD” => [“my”, “password”]

  • options (Hash)

    Options Hash

Options Hash (**options):

  • :default (String)

    default value if the configuration setting cannot be found

  • :secret_mount_directory (String)

    directory where secret files are mounted

Returns:

  • (Object)

    configuration setting value



31
32
33
34
35
36
# File 'lib/container_config/provider/base.rb', line 31

def load(key, *_dig_keys, **options)
  ContainerConfig.logger.debug do
    "Loading configuration value for #{key} with options #{options} from #{self.class}"
  end
  nil
end

#nameString

Returns name of the config value provider

Returns:

  • (String)

    provider name

Raises:



14
15
16
# File 'lib/container_config/provider/base.rb', line 14

def name
  raise ContainerConfig::MissingOverride, "Must override name method in derived class #{self.class}"
end