Skip to content

Commit efd87f8

Browse files
committed
Merge remote-tracking branch 'origin/main' into APL-1200
2 parents 97b331c + 03bc0b3 commit efd87f8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/otomi-stack.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,11 @@ export default class OtomiStack {
616616
const orig = this.getApp(id)
617617
if (orig && this.canToggleApp(id)) {
618618
const filePath = getResourceFilePath('AplApp', id)
619-
const aplApp = toPlatformObject('AplApp', id, { enabled, ...orig.values })
619+
const aplApp = toPlatformObject('AplApp', id, {
620+
...orig,
621+
enabled,
622+
values: { ...orig.values, enabled },
623+
})
620624
this.fileStore.set(filePath, aplApp)
621625

622626
const app = { ...orig, enabled }
@@ -1648,8 +1652,13 @@ export default class OtomiStack {
16481652
const teamObject = toTeamObject(teamId, data)
16491653
const aplRecord = await this.saveTeamWorkload(teamObject)
16501654

1651-
await this.saveTeamWorkloadValues(teamId, data.metadata.name, data.spec.values || '{}', true)
1652-
await this.doDeployment(aplRecord, false)
1655+
const valuesAplRecord = await this.saveTeamWorkloadValues(
1656+
teamId,
1657+
data.metadata.name,
1658+
data.spec.values || '{}',
1659+
true,
1660+
)
1661+
await this.doDeployments([aplRecord, valuesAplRecord], false)
16531662
return aplRecord.content as AplWorkloadResponse
16541663
}
16551664

@@ -1688,9 +1697,11 @@ export default class OtomiStack {
16881697
const aplRecord = await this.saveTeamWorkload(teamObject)
16891698
const workloadResponse = aplRecord.content as AplWorkloadResponse
16901699
if (data.spec && 'values' in data.spec) {
1691-
await this.saveTeamWorkloadValues(teamId, name, data.spec.values!)
1700+
const valuesAplRecord = await this.saveTeamWorkloadValues(teamId, name, data.spec.values!)
1701+
await this.doDeployments([aplRecord, valuesAplRecord], false)
1702+
} else {
1703+
await this.doDeployment(aplRecord, false)
16921704
}
1693-
await this.doDeployment(aplRecord, false)
16941705
return workloadResponse
16951706
}
16961707

0 commit comments

Comments
 (0)