|
1 | | -import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node' |
| 1 | +import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node' |
2 | 2 | import Debug from 'debug' |
3 | 3 |
|
4 | 4 | import { getRegions, ObjectStorageKeyRegions } from '@linode/api-v4' |
@@ -508,7 +508,9 @@ export default class OtomiStack { |
508 | 508 | this.fileStore.set(filePath, aplObject) |
509 | 509 |
|
510 | 510 | await this.saveSettings() |
511 | | - await this.doDeployment({ filePath, content: aplObject }) |
| 511 | + await this.doDeployment({ filePath, content: aplObject }, true, [ |
| 512 | + `${this.getRepoPath()}/env/settings/secrets.${settingId}.yaml`, |
| 513 | + ]) |
512 | 514 | return settings |
513 | 515 | } |
514 | 516 |
|
@@ -603,7 +605,7 @@ export default class OtomiStack { |
603 | 605 | this.fileStore.set(filePath, aplApp) |
604 | 606 |
|
605 | 607 | await this.saveAdminApp(app) |
606 | | - await this.doDeployment({ filePath, content: aplApp }) |
| 608 | + await this.doDeployment({ filePath, content: aplApp }, true, [`${this.getRepoPath()}/env/apps/secrets.${id}.yaml`]) |
607 | 609 | return this.getApp(id) |
608 | 610 | } |
609 | 611 |
|
@@ -636,7 +638,7 @@ export default class OtomiStack { |
636 | 638 | if (aplRecords.length === 0) { |
637 | 639 | throw new Error(`Failed toggling apps ${ids.toString()}`) |
638 | 640 | } |
639 | | - await this.doDeployments(aplRecords) |
| 641 | + await this.doDeployments(aplRecords, false) |
640 | 642 | } |
641 | 643 |
|
642 | 644 | getTeams(): Array<Team> { |
@@ -933,7 +935,7 @@ export default class OtomiStack { |
933 | 935 |
|
934 | 936 | async deleteNetpol(teamId: string, name: string): Promise<void> { |
935 | 937 | const filePath = await this.deleteTeamConfigItem('AplTeamNetworkControl', teamId, name) |
936 | | - await this.doDeleteDeployment([filePath], false) |
| 938 | + await this.doDeleteDeployment([filePath]) |
937 | 939 | } |
938 | 940 |
|
939 | 941 | getAllUsers(sessionUser: SessionUser): Array<User> { |
@@ -1039,7 +1041,7 @@ export default class OtomiStack { |
1039 | 1041 | } |
1040 | 1042 |
|
1041 | 1043 | await this.deleteUserFile(id) |
1042 | | - await this.doDeleteDeployment([filePath], false) |
| 1044 | + await this.doDeleteDeployment([filePath]) |
1043 | 1045 | } |
1044 | 1046 |
|
1045 | 1047 | private canTeamAdminUpdateUserTeams(sessionUser: SessionUser, existingUser: User, updatedUserTeams: string[]) { |
@@ -1197,7 +1199,7 @@ export default class OtomiStack { |
1197 | 1199 |
|
1198 | 1200 | async deleteCodeRepo(teamId: string, name: string): Promise<void> { |
1199 | 1201 | const filePath = await this.deleteTeamConfigItem('AplTeamCodeRepo', teamId, name) |
1200 | | - await this.doDeleteDeployment([filePath], false) |
| 1202 | + await this.doDeleteDeployment([filePath]) |
1201 | 1203 | } |
1202 | 1204 |
|
1203 | 1205 | async getRepoBranches(codeRepoName: string, teamId: string): Promise<string[]> { |
@@ -1376,7 +1378,7 @@ export default class OtomiStack { |
1376 | 1378 |
|
1377 | 1379 | async deleteBuild(teamId: string, name: string): Promise<void> { |
1378 | 1380 | const filePath = await this.deleteTeamConfigItem('AplTeamBuild', teamId, name) |
1379 | | - await this.doDeleteDeployment([filePath], false) |
| 1381 | + await this.doDeleteDeployment([filePath]) |
1380 | 1382 | } |
1381 | 1383 |
|
1382 | 1384 | getTeamPolicies(teamId: string): Policies { |
@@ -1710,7 +1712,7 @@ export default class OtomiStack { |
1710 | 1712 |
|
1711 | 1713 | async deleteWorkload(teamId: string, name: string): Promise<void> { |
1712 | 1714 | const filePath = await this.deleteTeamWorkload('AplTeamWorkload', teamId, name) |
1713 | | - await this.doDeleteDeployment([filePath], false) |
| 1715 | + await this.doDeleteDeployment([filePath]) |
1714 | 1716 | } |
1715 | 1717 |
|
1716 | 1718 | async editWorkloadValues(teamId: string, name: string, data: WorkloadValues): Promise<WorkloadValues> { |
@@ -1812,7 +1814,7 @@ export default class OtomiStack { |
1812 | 1814 |
|
1813 | 1815 | async deleteService(teamId: string, name: string): Promise<void> { |
1814 | 1816 | const filePath = await this.deleteTeamConfigItem('AplTeamService', teamId, name) |
1815 | | - await this.doDeleteDeployment([filePath], false) |
| 1817 | + await this.doDeleteDeployment([filePath]) |
1816 | 1818 | } |
1817 | 1819 |
|
1818 | 1820 | checkPublicUrlInUse(teamId: string, service: AplServiceRequest): void { |
@@ -1880,12 +1882,12 @@ export default class OtomiStack { |
1880 | 1882 | } |
1881 | 1883 | } |
1882 | 1884 |
|
1883 | | - async doDeleteDeployment(filePaths: string[], encryptSecrets = true, files?: string[]): Promise<void> { |
| 1885 | + async doDeleteDeployment(filePaths: string[]): Promise<void> { |
1884 | 1886 | const rootStack = await getSessionStack() |
1885 | 1887 |
|
1886 | 1888 | try { |
1887 | 1889 | // Commit and push Git changes |
1888 | | - await this.git.save(this.editor!, encryptSecrets, files) |
| 1890 | + await this.git.save(this.editor!, false) |
1889 | 1891 | // Pull the latest changes to ensure we have the most recent state |
1890 | 1892 | await rootStack.git.git.pull() |
1891 | 1893 |
|
@@ -2137,7 +2139,7 @@ export default class OtomiStack { |
2137 | 2139 | async deleteSealedSecret(teamId: string, name: string): Promise<void> { |
2138 | 2140 | const filePath = this.fileStore.deleteTeamResource('AplTeamSecret', teamId, name) |
2139 | 2141 | await this.git.removeFile(filePath) |
2140 | | - await this.doDeleteDeployment([filePath], false) |
| 2142 | + await this.doDeleteDeployment([filePath]) |
2141 | 2143 | } |
2142 | 2144 |
|
2143 | 2145 | async getSealedSecret(teamId: string, name: string): Promise<SealedSecret> { |
@@ -2220,7 +2222,7 @@ export default class OtomiStack { |
2220 | 2222 | const databasePath = getTeamDatabaseValuesFilePath(teamId, `${name}.yaml`) |
2221 | 2223 | await this.git.removeFile(relativePath) |
2222 | 2224 | await this.git.removeFile(databasePath) |
2223 | | - await this.doDeleteDeployment([filePath], false) |
| 2225 | + await this.doDeleteDeployment([filePath]) |
2224 | 2226 | } |
2225 | 2227 |
|
2226 | 2228 | async getAplKnowledgeBase(teamId: string, name: string): Promise<AplKnowledgeBaseResponse> { |
@@ -2290,7 +2292,7 @@ export default class OtomiStack { |
2290 | 2292 | const filePath = this.fileStore.deleteTeamResource('AkamaiAgent', teamId, name) |
2291 | 2293 |
|
2292 | 2294 | await this.git.removeFile(filePath) |
2293 | | - await this.doDeleteDeployment([filePath], false) |
| 2295 | + await this.doDeleteDeployment([filePath]) |
2294 | 2296 | } |
2295 | 2297 |
|
2296 | 2298 | getAplAgent(teamId: string, name: string): AplAgentResponse { |
|
0 commit comments