Skip to content

Commit

Permalink
feat(controller): allow default reconcile behavior to be configured
Browse files Browse the repository at this point in the history
allows for the environment variable `MTP_RECONCILE_BY_DEFAULT` to
change the reconcile behavior of mustache template unless explicitly
over ridden at the template level. If not specified the default
reconcile behavior is `true` or to reconcile the associated resources by
default
  • Loading branch information
esatterwhite committed Nov 4, 2022
1 parent 26000ee commit 544caa9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions kubernetes/MustacheTemplate/resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ items:
value: razee-io/mustachetemplate
- name: USER_AGENT_VERSION
value: "{{{TRAVIS_TAG}}}"
- name: MTP_RECONCILE_BY_DEFAULT
valueFrom:
configMapKeyRef:
name: razeedeploy-overrides
key: MTP_RECONCILE_BY_DEFAULT
optional: true
- name: CRD_WATCH_TIMEOUT_SECONDS
valueFrom:
configMapKeyRef:
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ async function createNewEventHandler(kc) {
kubeClass: kc,
logger: log,
requestOptions: { qs: { timeoutSeconds: process.env.CRD_WATCH_TIMEOUT_SECONDS || 300 } },
livenessInterval: true
livenessInterval: true,
options: {
reconcileByDefault: process.env.MTP_RECONCILE_BY_DEFAULT || null
}
};
result = new EventHandler(params);
} else {
Expand Down

0 comments on commit 544caa9

Please sign in to comment.