kubernetes-operator 0.0.4 → 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kubernetes-operator.rb +10 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1381c210b1d1b87dececde16b1f04cfcf661a0bf3352833ba427f34eb8cabadd
4
- data.tar.gz: 565c20d59f1dec816b089ec31ef398cb4bf93c98dbaa605c2374ccaf23c4c216
3
+ metadata.gz: f594436b606a9874d099009d5428952569792547c090199b08553b5bac9828bf
4
+ data.tar.gz: cf8f0c651177e18aa07b682cb05c4b0c716908151e72dcadbae2edb9c4ee4139
5
5
  SHA512:
6
- metadata.gz: 9e55012c03c012bfb6f349446b58a39efca9672e0ec00f7a559f906e1b4a0fc9a02dc7a4a93c4d360faeb56448295a5217aa0322a9e7cd1638f6b51c6447842e
7
- data.tar.gz: 34666b517622bbf9e759fedd5ca375187c30a4e72c15bb134519bd085634cca84ffba4019420e6492d9a74070a87791375f50eabfe323d74f3f262ebd4be6d65
6
+ metadata.gz: 04221fa717adb6c04562554236980e56a01f8ea90c491f33cabe6df62b99935739cc63ecbc03cd1c7db509cadb857bf5ed96dc8ddc4654d407d15e1f8a774385
7
+ data.tar.gz: a6564a4cbf18e78ee6a7dee2589c1db1862763b61133c3ba7f14f63f636a18847425acf09767f33459313b29ea731a98d32c5d49ce9b9b9ed07223f049e05717
@@ -122,7 +122,11 @@ class KubernetesOperator
122
122
  patched = @k8sclient.patch_entity(@crdPlural,notice[:object][:metadata][:name], {metadata: {finalizers: ["#{@crdPlural}.#{@crdVersion}.#{@crdGroup}"]}},'merge-patch',@options[:namespace])
123
123
  # trigger action
124
124
  @logger.info("trigger add action for #{notice[:object][:metadata][:name]} (#{notice[:object][:metadata][:uid]})")
125
- @addMethod.call(notice[:object],@k8sclient)
125
+ resp = @addMethod.call(notice[:object],@k8sclient)
126
+ # update status
127
+ if resp[:status]
128
+ @k8sclient.patch_entity(@crdPlural,notice[:object][:metadata][:name]+"/status", {status: resp[:status]},'merge-patch',@options[:namespace])
129
+ end
126
130
  # save version
127
131
  @store.transaction do
128
132
  @store[patched[:metadata][:uid]] = patched[:metadata][:resourceVersion]
@@ -139,7 +143,11 @@ class KubernetesOperator
139
143
  unless notice[:object][:metadata][:deletionTimestamp]
140
144
  # trigger action
141
145
  @logger.info("trigger update action for #{notice[:object][:metadata][:name]} (#{notice[:object][:metadata][:uid]})")
142
- @updateMethod.call(notice[:object],@k8sclient)
146
+ resp = @updateMethod.call(notice[:object],@k8sclient)
147
+ # update status
148
+ if resp[:status]
149
+ @k8sclient.patch_entity(@crdPlural,notice[:object][:metadata][:name]+"/status", {status: resp[:status]},'merge-patch',@options[:namespace])
150
+ end
143
151
  # save version
144
152
  @store.transaction do
145
153
  @store[notice[:object][:metadata][:uid]] = notice[:object][:metadata][:resourceVersion]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kuntzsch