configgin 0.20.1 → 0.20.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63612fca928e0ea9680d2aa934bba36d415b181b1a50aa6d658a6106d4d19594
4
- data.tar.gz: a43f3edbf53a5873bebab509a63e4ec4d3205f64acce45a6a74e6123aa1e6b7e
3
+ metadata.gz: 4c7414ca5ae185e043c4b5e085cd3d32bbd45e18f69faf400a35c30902ac56b8
4
+ data.tar.gz: 663a9ce843fea21f5395ab635c5636808905e12174a07260d488cdb0d489dfe0
5
5
  SHA512:
6
- metadata.gz: ed1530692c0fe508e0c44a85e1a3b79cf47d31ca48333702916205cee433849292682ae27b0344bec189fd8dc99ff802b54644de3e9af165661d621a7691a418
7
- data.tar.gz: 74ecda31ff9283ae672631db17ae1c61a4b0fd24e65c1e4521b875835702ddcd5949c7ed2d6555f50776d29aa51f3eb20ca1458e5f89c78201caa82fbb1045ee
6
+ metadata.gz: 18be60efb06a4b567b03a2d6ff1561495629e27cdc99f9417521146ac1a544d9b1be23a09cd077a544958b639a578e3d8e6787734cb856a1333c86e4b83647c3
7
+ data.tar.gz: 96099aab13ec542bb195dc4ca6f63cc4fc374a68fe05f6101c85b134e2e7f2cc7efbf5e67ba8e83e856071ae0316e82511f05eebd922b698841c4301b43932ff
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- configgin (0.20.1)
4
+ configgin (0.20.1.1)
5
5
  bosh-template (~> 2.0)
6
6
  deep_merge (~> 1.1)
7
7
  kubeclient (~> 4.3)
@@ -71,7 +71,8 @@ class Configgin
71
71
  def export_job_properties(jobs)
72
72
  # Co-located containers don't get to export properties.
73
73
  return unless instance_group == ENV["KUBERNETES_CONTAINER_NAME"]
74
- # Jobs (errands) don't export properties.
74
+ # Jobs (errands) and unowned pods (tests) don't export properties.
75
+ return unless self_pod['metadata']['ownerReferences']
75
76
  return unless self_pod['metadata']['ownerReferences'][0]['kind'] == "StatefulSet"
76
77
 
77
78
  sts = kube_client_stateful_set.get_stateful_set(instance_group, kube_namespace)
@@ -101,12 +102,12 @@ class Configgin
101
102
 
102
103
  # version tag changes whenever the chart version or the secrets generation changes
103
104
  version_tag = ENV["CONFIGGIN_VERSION_TAG"]
104
- new_tag = !secret.data.to_h.key?(version_tag.to_sym)
105
+ new_tag = !secret.data[version_tag]
105
106
  secret.data = {version_tag => ""} if new_tag # make sure old properties are deleted during upgrade
106
107
 
107
108
  digests = {}
108
109
  jobs.each do |name, job|
109
- secret.data["skiff-exported-properties-#{name}"] = Base64.encode64(job.exported_properties.to_json)
110
+ secret.data["skiff-exported-properties-#{name}"] = Base64.strict_encode64(job.exported_properties.to_json)
110
111
  digests[name] = property_digest(job.exported_properties)
111
112
 
112
113
  # Record initial digest values whenever the tag changes, in which case the pod startup
@@ -114,9 +115,10 @@ class Configgin
114
115
  # tags in the corresponding secrets. There is no annotation when importing this set of
115
116
  # initial values because the helm chart doesn't include any annotations, and we don't
116
117
  # want to trigger a pod restart by adding them.
117
- encoded_digest = Base64.encode64(digests[name])
118
+ encoded_digest = Base64.strict_encode64(digests[name])
118
119
  if new_tag
119
120
  secret.data["skiff-initial-digest-#{name}"] = encoded_digest
121
+ secret.data["skiff-initial-properties-#{name}"] = secret.data["skiff-exported-properties-#{name}"]
120
122
  end
121
123
  if secret.data["skiff-initial-digest-#{name}"] == encoded_digest
122
124
  digests[name] = nil
@@ -124,6 +126,11 @@ class Configgin
124
126
  end
125
127
  kube_client.update_secret(secret)
126
128
 
129
+ warn "new_tag=#{new_tag}"
130
+ secret.data.to_h.each_pair do |key, value|
131
+ warn "secret.data[#{key}]=#{value}"
132
+ end
133
+
127
134
  # Some pods might depend on the properties exported by this pod; add annotations
128
135
  # to the template spec of the stateful sets so that the pods will be restarted if
129
136
  # the exported values have changed from the initial values.
@@ -154,9 +161,11 @@ class Configgin
154
161
  # only restarts pods when the checksum of the pod spec changes, so no-op "updates" are ok.
155
162
  annotations = {}
156
163
  sts.spec.template.metadata.annotations.each_pair do |key, value|
164
+ warn "Copying old annotation #{key}=#{value}"
157
165
  annotations[key] = value
158
166
  end
159
167
  digests.each_pair do |key, value|
168
+ warn "Setting new annotation #{key}=#{value}"
160
169
  annotations[key] = value
161
170
  end
162
171
 
@@ -1,3 +1,3 @@
1
1
  class Configgin
2
- VERSION = '0.20.1'.freeze
2
+ VERSION = '0.20.1.1'.freeze
3
3
  end
@@ -81,7 +81,7 @@ class KubeLinkSpecs
81
81
  # tag in the corresponding secret.
82
82
  secret = client.get_secret(role_name, namespace)
83
83
  begin
84
- JSON.parse(Base64.decode64(secret.data["skiff-exported-properties-#{job_name}"]))
84
+ JSON.parse(Base64.strict_decode64(secret.data["skiff-exported-properties-#{job_name}"]))
85
85
  rescue
86
86
  puts "Role #{role_name} is missing skiff-exported-properties-#{job_name}"
87
87
  fail
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configgin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.20.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUSE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-17 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler