Skip to content
Snippets Groups Projects
Commit de3bffe0 authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'cache-policy' into 'main'

Support `cache_policy` input in job templates

See merge request components/opentofu!167
parents 9a505e84 53dc08b4
Branches
Tags
No related merge requests found
...@@ -95,6 +95,10 @@ spec: ...@@ -95,6 +95,10 @@ spec:
default: [{when: on_success}] default: [{when: on_success}]
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
...@@ -107,6 +111,7 @@ spec: ...@@ -107,6 +111,7 @@ spec:
rules: $[[ inputs.rules ]] rules: $[[ inputs.rules ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -82,6 +82,11 @@ spec: ...@@ -82,6 +82,11 @@ spec:
type: array type: array
description: 'Defines the `needs` of the job.' description: 'Defines the `needs` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
'$[[ inputs.as ]]': '$[[ inputs.as ]]':
...@@ -89,6 +94,7 @@ spec: ...@@ -89,6 +94,7 @@ spec:
needs: $[[ inputs.needs ]] needs: $[[ inputs.needs ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -95,6 +95,10 @@ spec: ...@@ -95,6 +95,10 @@ spec:
default: [{when: on_success}] default: [{when: on_success}]
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
...@@ -107,6 +111,7 @@ spec: ...@@ -107,6 +111,7 @@ spec:
rules: $[[ inputs.rules ]] rules: $[[ inputs.rules ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -92,6 +92,11 @@ spec: ...@@ -92,6 +92,11 @@ spec:
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
'$[[ inputs.as ]]': '$[[ inputs.as ]]':
...@@ -101,6 +106,7 @@ spec: ...@@ -101,6 +106,7 @@ spec:
allow_failure: $[[ inputs.allow_failure ]] allow_failure: $[[ inputs.allow_failure ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -89,6 +89,10 @@ spec: ...@@ -89,6 +89,10 @@ spec:
default: [] default: []
type: array type: array
description: 'Defines the `needs` of the job.' description: 'Defines the `needs` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
...@@ -97,6 +101,7 @@ spec: ...@@ -97,6 +101,7 @@ spec:
needs: $[[ inputs.needs ]] needs: $[[ inputs.needs ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -94,6 +94,10 @@ spec: ...@@ -94,6 +94,10 @@ spec:
default: [{when: on_success}] default: [{when: on_success}]
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
...@@ -116,6 +120,7 @@ spec: ...@@ -116,6 +120,7 @@ spec:
rules: $[[ inputs.rules ]] rules: $[[ inputs.rules ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -91,6 +91,10 @@ spec: ...@@ -91,6 +91,10 @@ spec:
default: [{when: on_success}] default: [{when: on_success}]
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
...@@ -100,6 +104,7 @@ spec: ...@@ -100,6 +104,7 @@ spec:
rules: $[[ inputs.rules ]] rules: $[[ inputs.rules ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
...@@ -88,6 +88,11 @@ spec: ...@@ -88,6 +88,11 @@ spec:
type: array type: array
description: 'Defines the `rules` of the job.' description: 'Defines the `rules` of the job.'
cache_policy:
default: pull-push
type: string
description: 'Defines the cache policy of the job.'
--- ---
'$[[ inputs.as ]]': '$[[ inputs.as ]]':
...@@ -95,6 +100,7 @@ spec: ...@@ -95,6 +100,7 @@ spec:
rules: $[[ inputs.rules ]] rules: $[[ inputs.rules ]]
cache: cache:
key: "$__CACHE_KEY_HACK" key: "$__CACHE_KEY_HACK"
policy: $[[ inputs.cache_policy ]]
paths: paths:
- $TF_ROOT/.terraform/ - $TF_ROOT/.terraform/
variables: variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment