kube_cluster 1.6.0 → 1.7.0

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: c8a1a110a7fc51055c3b0b6c7bed9c90ef99a7f5d3270aada0f9b89b7fba5eb0
4
- data.tar.gz: 07a7eb71bc8a0d9e9197fb24a76729764de4e237c68110fc1a486d0df38eec74
3
+ metadata.gz: c57aae5fbe1903b9bc6bd63073ed4dd9d5731102b524077c4969051593b84b86
4
+ data.tar.gz: 19a1be373f25d1faee87bf83072c45987ecac39cc384c932168e4afefc42a7ac
5
5
  SHA512:
6
- metadata.gz: 8bc59ca6435b4f4b9096bb7925605211289ee6a337015fc3eba64d747d673adce333a391585b5235c961f5a681f23474588d8391d88c12e51af5c5d5026fed06
7
- data.tar.gz: 73c07cf7c0c85c0f998dc2b406da0d385502d24e414194eeb5f2e2dfbecbef3bedcef8401678e73a0b53665bc1d62465a6cd9ef77b962e07c761ecdca09b8620
6
+ metadata.gz: db92c45266952b68584a01029cd2502caa5ab1ea2e9d010e91bf70b9385227578378d36be82c3c83eb3cf3966b04b2547732d63bd706555cd3fef6e14c28c869
7
+ data.tar.gz: a53b5a9d8165400643e0693259940f5cf2695d97afd12a258e20dc7ecbd9bfd04aed135803e1d402ec2c3215bb5e17e64d98da8725cb45175a3d208b08c419b1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.7.0] - 2026-09-17
9
+
10
+ ### Added
11
+ - `Standard::EnvProcessing` now maps `ESO::ExternalSecret::KeyRef` (the struct
12
+ returned by `ExternalSecret#key`) to a `secretKeyRef` env var, mirroring the
13
+ support `VolumeProcessing` has always had. Unlike `.template`, `.key`
14
+ registers nothing on the ExternalSecret — it references a key the secret
15
+ already materialises (declared via `keys:` at construction, or by a
16
+ `.template` call elsewhere). This makes `Custom::PassboltSecret`-style
17
+ secrets — whose template is fully built at construction — usable from env
18
+ hashes, where previously the only option was a raw `valueFrom` hash or a
19
+ whole-secret `envFrom`.
20
+
8
21
  ## [1.6.0] - 2026-08-03
9
22
 
10
23
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kube_cluster (1.6.0)
4
+ kube_cluster (1.7.0)
5
5
  activesupport (~> 8.0)
6
6
  kube_kubectl (~> 2.0)
7
7
  kube_schema (~> 1.10.0)
@@ -22,6 +22,14 @@ module Kube
22
22
  # "FOO" => Secret.new(name: "creds").key("bar")
23
23
  # => { name: "FOO", valueFrom: { secretKeyRef: { name: "creds", key: "bar" } } }
24
24
  #
25
+ # ExternalSecret::KeyRef values reference a key the ExternalSecret
26
+ # already materialises (declared via keys: at construction, or by a
27
+ # .template call elsewhere) -- unlike .template, .key registers
28
+ # NOTHING on the ExternalSecret. Reference a key that never lands in
29
+ # the target Secret and the pod sits in CreateContainerConfigError.
30
+ # "FOO" => ExternalSecret::Creds.key("bar")
31
+ # => { name: "FOO", valueFrom: { secretKeyRef: { name: "creds", key: "bar" } } }
32
+ #
25
33
  def self.process(env)
26
34
  return env if env.is_a?(Array)
27
35
  return [] if env.nil?
@@ -33,7 +41,7 @@ module Kube
33
41
  when ESO::ExternalSecret::TemplateRef
34
42
  value.secret.register_template!(key, value.template_value)
35
43
  { name: key, valueFrom: { secretKeyRef: { name: value.secret.secret_name, key: key } } }
36
- when Kube::Cluster::Standard::Secret::KeyRef
44
+ when ESO::ExternalSecret::KeyRef, Kube::Cluster::Standard::Secret::KeyRef
37
45
  { name: key, valueFrom: { secretKeyRef: { name: value.secret.secret_name, key: value.key_name } } }
38
46
  else
39
47
  { name: key, value: value.to_s }
@@ -58,6 +66,23 @@ describe "EnvProcessing" do
58
66
  ]
59
67
  end
60
68
 
69
+ it "maps an ExternalSecret::KeyRef to a secretKeyRef env var without registering anything" do
70
+ secret = Kube::Cluster::Standard::ESO::ExternalSecret.new(
71
+ name: "svix-jwt", store: "passbolt", remote_key: "svix-jwt",
72
+ keys: { "SVIX_JWT_SECRET" => "SVIX_JWT_SECRET" }
73
+ )
74
+
75
+ Kube::Cluster::Standard::EnvProcessing
76
+ .process("SVIX_JWT_SECRET" => secret.key("SVIX_JWT_SECRET"))
77
+ .should == [
78
+ { name: "SVIX_JWT_SECRET", valueFrom: { secretKeyRef: { name: "svix-jwt", key: "SVIX_JWT_SECRET" } } }
79
+ ]
80
+
81
+ # Unlike .template, .key must not touch the ExternalSecret's spec.
82
+ secret.to_h.dig(:spec, :target, :template).should.be.nil
83
+ secret.to_h.dig(:spec, :data).length.should == 1
84
+ end
85
+
61
86
  it "still maps plain string values to value env vars" do
62
87
  Kube::Cluster::Standard::EnvProcessing
63
88
  .process("FOO" => "bar")
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kube
4
4
  module Cluster
5
- VERSION = "1.6.0"
5
+ VERSION = "1.7.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kube_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan K