Class: Kubec::Config::Downloader
- Inherits:
-
Object
- Object
- Kubec::Config::Downloader
- Defined in:
- lib/kubec/config/downloader.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize ⇒ Downloader
constructor
A new instance of Downloader.
- #save ⇒ Object
Constructor Details
#initialize ⇒ Downloader
Returns a new instance of Downloader.
7 8 9 10 11 12 13 |
# File 'lib/kubec/config/downloader.rb', line 7 def initialize @result = `kubectl -n #{fetch(:stage, :staging)} get configmap -o json` @success = $CHILD_STATUS.success? @items = {} prepare end |
Instance Method Details
#save ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/kubec/config/downloader.rb', line 15 def save Kubernetes.config.each do |config| downloaded = @items[config.name] config.files.each do |(key, path)| write path, downloaded.dig('data', key) end end end |