kubekrypt 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aafcb114c98241aef71fcd5bb8cc2da885720fe50ef89d6986595a86108e6066
4
- data.tar.gz: 5b4acdd48ddbf46aad74fa089c7c5de1a1d219c924836a9edf4ab528d38c389d
3
+ metadata.gz: e71a844906b188fbb2f4adca4d2ccae9cf45380a9be2bb6b16c1890bc1c37b68
4
+ data.tar.gz: a42f8a26b5f1991f5141b0b988c3412f1680d7045de982f46aa66bc65a83f3eb
5
5
  SHA512:
6
- metadata.gz: 5b093a42bfaae3bf5dc63956c38c4ad454c87a5c91d56be298550a7c8bfc11ce9ff6403da1c8a6eddafcc415e1791a0889f8cb3c02c60faa7a76cf4dfdf936cd
7
- data.tar.gz: 145e1b546e18b9540273025e809f70fac4051c0b21a2d7d7e9739dbec7fed9bfa434812e6cfc340e33f1aff7ce972f41796c8c8aceff5575817a376102b5364e
6
+ metadata.gz: 967a4d2b36bfd9ff119d9fa5dafc6e8419a000bee7a34fcbb32d30d91fc3efa7fd52529673147f7196527a7db79b0f46bc3489491033058f635efb97bff756d1
7
+ data.tar.gz: d414ff61b5e4971d22bdd7906c2b8cabbb56011f37c8072cd34833c22beacb851277173a70db57ff5e84770a4be57471ae3aa6245de8edf0ce8cf8f4bd8c9156
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.1.1] - 2026-03-24
4
+
5
+ ### Fixed
6
+ - Typos in error class names (`AlreadyEncryptedError`, `NotEncryptedError`)
7
+ - CLI now prints clean error messages instead of backtraces on failure
8
+ - Use `METADATA_KEY` constant consistently in CLI
9
+
3
10
  ## [2.1.0] - 2026-03-24
4
11
 
5
12
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kubekrypt (2.1.0)
4
+ kubekrypt (2.1.1)
5
5
  google-cloud-kms
6
6
  grpc (< 1.74.0)
7
7
  thor (>= 1.0)
data/lib/kubekrypt/cli.rb CHANGED
@@ -18,10 +18,19 @@ module KubeKrypt
18
18
  content = YAML.safe_load(yaml_content)
19
19
  key_name = options.fetch(KMS_KEY)
20
20
 
21
- raise AlreadyEncrytpedError, "#{file_path} is already encrypted" if content["kubekrypt"]
21
+ raise AlreadyEncryptedError, "#{file_path} is already encrypted" if content[METADATA_KEY]
22
22
 
23
23
  result = KubeKrypt::Encryptor.call(content:, key_name:)
24
24
  puts result
25
+ rescue AlreadyEncryptedError, NotEncryptedError => e
26
+ warn "Error: #{e.message}"
27
+ exit 1
28
+ rescue Errno::ENOENT
29
+ warn "Error: file not found: #{file_path}"
30
+ exit 1
31
+ rescue => e
32
+ warn "Error: #{e.message}"
33
+ exit 1
25
34
  end
26
35
 
27
36
  method_option :base64, desc: "Base64 encoded values", type: :boolean, required: false
@@ -31,10 +40,19 @@ module KubeKrypt
31
40
  content = YAML.safe_load(yaml_content)
32
41
  base64 = options.fetch(:base64, false)
33
42
 
34
- raise NotEncrytpedError, "#{file_path} is not encrypted" unless content["kubekrypt"]
43
+ raise NotEncryptedError, "#{file_path} is not encrypted" unless content[METADATA_KEY]
35
44
 
36
45
  result = KubeKrypt::Decryptor.call(content:, base64:)
37
46
  puts result
47
+ rescue AlreadyEncryptedError, NotEncryptedError => e
48
+ warn "Error: #{e.message}"
49
+ exit 1
50
+ rescue Errno::ENOENT
51
+ warn "Error: file not found: #{file_path}"
52
+ exit 1
53
+ rescue => e
54
+ warn "Error: #{e.message}"
55
+ exit 1
38
56
  end
39
57
  end
40
58
  end
@@ -1,3 +1,3 @@
1
1
  module KubeKrypt
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.1.1".freeze
3
3
  end
data/lib/kubekrypt.rb CHANGED
@@ -5,8 +5,8 @@ require "thor"
5
5
  require "yaml"
6
6
 
7
7
  module KubeKrypt
8
- AlreadyEncrytpedError = Class.new(StandardError)
9
- NotEncrytpedError = Class.new(StandardError)
8
+ AlreadyEncryptedError = Class.new(StandardError)
9
+ NotEncryptedError = Class.new(StandardError)
10
10
  KMS_KEY = :kms_key
11
11
  ENCRYPTION_METHOD = "aes-256-gcm".freeze
12
12
  METADATA_KEY = "kubekrypt".freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubekrypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik