Skip to content

Commit

Permalink
feat: Expose environment variable to controll default reconcile behav…
Browse files Browse the repository at this point in the history
…ior (#441)

* chore(dep): razee/kubnernetes-util@1.1.0

exposes the options object in the main event handler

* chore(dep): razee/razeedeploy-core@1.3.0

allow default reconcile behavior to be configured

* feat(controller): allow default reconcile behavior to be configured

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 authored Nov 4, 2022
1 parent 752f78c commit b8a589a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
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
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
},
"license": "Apache-2.0",
"dependencies": {
"@razee/kubernetes-util": "^1.0.2",
"@razee/razeedeploy-core": "^1.2.2",
"@razee/kubernetes-util": "^1.1.0",
"@razee/razeedeploy-core": "^1.3.0",
"handlebars": "^4.7.7",
"js-yaml": "^4.1.0",
"mustache": "^4.2.0",
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 || true
}
};
result = new EventHandler(params);
} else {
Expand Down

0 comments on commit b8a589a

Please sign in to comment.