Class: Kubec::Secret::Downloader
- Inherits:
-
Object
- Object
- Kubec::Secret::Downloader
- Defined in:
- lib/kubec/secret/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/secret/downloader.rb', line 7 def initialize @result = `kubectl -n #{fetch(:stage, :staging)} get secret -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/secret/downloader.rb', line 15 def save Kubernetes.secret.each do |secret| downloaded = @items[secret.name] secret.files.each do |(key, path)| write path, Base64.decode64(downloaded.dig('data', key)) end end end |