Class: KubeKrypt::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Shell
Defined in:
lib/kubekrypt/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/kubekrypt/cli.rb', line 5

def self.exit_on_failure?
  true
end

Instance Method Details

#decrypt(*paths) ⇒ Object



27
28
29
30
31
32
# File 'lib/kubekrypt/cli.rb', line 27

def decrypt(*paths)
  base64 = options.fetch(:base64, false)
  in_place = options[:in_place]

  expand(paths).each { |file_path| process_decrypt(file_path, base64:, in_place:) }
end

#encrypt(*paths) ⇒ Object



17
18
19
20
21
22
# File 'lib/kubekrypt/cli.rb', line 17

def encrypt(*paths)
  key_name = options.fetch(KMS_KEY)
  in_place = options[:in_place]

  expand(paths).each { |file_path| process_encrypt(file_path, key_name:, in_place:) }
end

#versionObject



10
11
12
# File 'lib/kubekrypt/cli.rb', line 10

def version
  puts KubeKrypt::VERSION
end