kubernetes-deploy 0.6.4 → 0.6.5

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
  SHA1:
3
- metadata.gz: 8b4d3ec7725c3ec9ab4448d80fa150561f3d995f
4
- data.tar.gz: 9cd250544223176d59502206e900134db8e555bd
3
+ metadata.gz: 35d948d40aa56e5e5a6768970fd3337a23567aa5
4
+ data.tar.gz: 69e976d7ff55b67d735e35def340386abb007168
5
5
  SHA512:
6
- metadata.gz: f4aa53225bad0d7c8d449de8cf715329040d60a7d2b09996bc6cedbc607d0ac6e6ac508cc83d10a42f476d40233685f16ddbaf78b95b7981c55a9fb5736cf18e
7
- data.tar.gz: a16baf80e0c4239267f9617271e0bc93fb2c6a3ff3260581ca671dc5371a8825288a94d5085480845595ac5228df959f8ae9f46d738b63d1833dc3cd2170aac5
6
+ metadata.gz: 69ff1c41cc62e2489680586a97f6392678c1110ac0cd729d5d90fcb3e0d27012eae5db56dccb7edd88e24dda0d7604ba7bc83a96ecc0b3ffab935c6128da4012
7
+ data.tar.gz: 0fcf662530afff4ffff89a4f3eba3ef2b92dc61d3ca7f5c6bc4810987017405192350f9137d1a0da79b4bfeb75bf3fa3f4a9ac1462df2699bbd060535c39056c
data/README.md CHANGED
@@ -76,6 +76,21 @@ Since their data is only base64 encoded, Kubernetes secrets should not be commit
76
76
  6. Encrypt the file: `ejson encrypt /PATH/TO/secrets.ejson`
77
77
  7. Commit the encrypted file and deploy as usual. The deploy will create secrets from the data in the `kubernetes_secrets` key.
78
78
 
79
+ **Note**: Since leading underscores in ejson keys are used to skip encryption of the associated value, `kubernetes-deploy` will strip these leading underscores when it creates the keys for the Kubernetes secret data. For example, given the ejson data below, the `monitoring-token` secret will have keys `api-token` and `property` (_not_ `_property`):
80
+ ```json
81
+ {
82
+ "_public_key": "YOUR_PUBLIC_KEY",
83
+ "kubernetes_secrets": {
84
+ "monitoring-token": {
85
+ "_type": "kubernetes.io/tls",
86
+ "data": {
87
+ "api-token": "EJ[ENCRYPTED]",
88
+ "_property": "some unencrypted value"
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
79
94
  ### Running one off tasks
80
95
 
81
96
  To trigger a one-off job such as a rake task _outside_ of a deploy, use the following command:
@@ -122,7 +122,10 @@ module KubernetesDeploy
122
122
  raise EjsonSecretError, "Data for secret #{secret_name} was invalid. Only key-value pairs are permitted."
123
123
  end
124
124
  encoded_data = data.each_with_object({}) do |(key, value), encoded|
125
- encoded[key] = Base64.encode64(value)
125
+ # Leading underscores in ejson keys are used to skip encryption of the associated value
126
+ # To support this ejson feature, we need to exclude these leading underscores from the secret's keys
127
+ secret_key = key.sub(/\A_/, '')
128
+ encoded[secret_key] = Base64.encode64(value)
126
129
  end
127
130
 
128
131
  secret = {
@@ -1,3 +1,3 @@
1
1
  module KubernetesDeploy
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kir Shatrov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-05-09 00:00:00.000000000 Z
13
+ date: 2017-05-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport