qbec icon indicating copy to clipboard operation
qbec copied to clipboard

add recreate option for update-policy directive

Open kvaps opened this issue 4 years ago • 3 comments

This PR adds new option:

directives.qbec.io/update-policy: recreate

Which allow to recreate resources when they change. This might be really useful for updating jobs and some other immutable objects eg. storage class.

see https://github.com/kubernetes/kubernetes/issues/89657 for more details

solves: https://github.com/splunk/qbec/issues/64 partially solves: https://github.com/splunk/qbec/issues/149

Now post-install and post-upgrade helm hooks can be achieved by rewriting them with directives.qbec.io/update-policy: recreate annotation)

Another trick can be used if you really need to run job every apply, this can be achieved by adding another annotation with random data, eg.:

  annotations: {
    'directives.qbec.io/update-policy': 'recreate',
    'apply-uuid': importstr "/proc/sys/kernel/random/uuid"
  }

kvaps avatar Dec 21 '20 16:12 kvaps

Codecov Report

Merging #189 (c4ceba0) into master (3ef9f8e) will decrease coverage by 0.38%. The diff coverage is 9.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
- Coverage   73.30%   72.92%   -0.39%     
==========================================
  Files          51       51              
  Lines        4252     4284      +32     
==========================================
+ Hits         3117     3124       +7     
- Misses        961      986      +25     
  Partials      174      174              
Impacted Files Coverage Δ
internal/remote/client.go 0.00% <0.00%> (ø)
internal/commands/apply.go 79.33% <100.00%> (+0.27%) :arrow_up:
internal/commands/directives.go 100.00% <100.00%> (ø)
internal/eval/eval.go 94.61% <0.00%> (ø)
internal/commands/diff.go 85.30% <0.00%> (ø)
internal/model/app.go 94.71% <0.00%> (+0.01%) :arrow_up:
internal/commands/config.go 89.24% <0.00%> (+0.05%) :arrow_up:
internal/model/k8s.go 90.00% <0.00%> (+0.41%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3ef9f8e...c4ceba0. Read the comment docs.

codecov-io avatar Dec 21 '20 16:12 codecov-io

@gotwarlost any updates here? The PR is open for a quite some time and contains meaningful changes. Could you please consider reviewing it again?

Andor avatar Oct 05 '21 13:10 Andor

will do shortly.

gotwarlost avatar Oct 06 '21 21:10 gotwarlost