Class: Helmsnap::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/helmsnap/config.rb

Defined Under Namespace

Classes: Credentials

Constant Summary collapse

DEFAULT_ENV =
"default"
DEFAULT_SNAPSHOTS_PATH =
"helm/snapshots"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_path) ⇒ Config

Returns a new instance of Config.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/helmsnap/config.rb', line 11

def initialize(config_path)
  if config_path.exist?
    yaml = YAML.load_file(config_path.to_s)
  else
    yaml = {}
  end

  self.envs = parse_envs(yaml)
  self.snapshots_path = parse_snaphots_path(yaml)
  self.credentials = parse_credentials(yaml)
end

Instance Attribute Details

#credentialsObject

Returns the value of attribute credentials.



6
7
8
# File 'lib/helmsnap/config.rb', line 6

def credentials
  @credentials
end

#envsObject

Returns the value of attribute envs.



6
7
8
# File 'lib/helmsnap/config.rb', line 6

def envs
  @envs
end

#snapshots_pathObject

Returns the value of attribute snapshots_path.



6
7
8
# File 'lib/helmsnap/config.rb', line 6

def snapshots_path
  @snapshots_path
end