Skip to content

Commit

Permalink
Fix a variable conflict
Browse files Browse the repository at this point in the history
I can't have both the global and deployment configs called `config`.
Call the deployment config `spec`.
  • Loading branch information
amrc-benmorrow committed Jul 15, 2024
1 parent 145d1d8 commit 4cbc688
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions acs-edge-sync/lib/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export class Deployments {
* deployed. */
const lookup = list => rx.from(list).pipe(
rx.mergeMap(agent => cdb.get_config(Deployments, agent)
.then(config => ({ uuid: agent, config }))),
rx.mergeMap(deployment => rx.from(deployment.config.charts).pipe(
.then(spec => ({ uuid: agent, spec }))),
rx.mergeMap(deployment => rx.from(deployment.spec.charts).pipe(
rx.mergeMap(ch => cdb.get_config(HelmChart, ch)),
/* XXX We could cache (against an etag) to avoid
* recompiling every time... */
Expand Down Expand Up @@ -186,13 +186,13 @@ export class Deployments {
create_manifests ({ config, deployments }) {
return imm.List(deployments)
.map(deployment => {
const { uuid, config } = deployment;
const { uuid, spec } = deployment;
const chart = deployment.chart({
uuid,
name: config.name,
hostname: config.hostname,
name: spec.name,
hostname: spec.hostname,
});
const values = [this.values, chart.values, config.values]
const values = [this.values, chart.values, spec.values]
.map(v => v ?? {}).reduce(jmp.merge);
return config.template({
uuid, values,
Expand Down

0 comments on commit 4cbc688

Please sign in to comment.