Skip to content

Commit 560840c

Browse files
committed
Merge remote-tracking branch 'origin/main' into add-fmodel-endpoint
2 parents da70102 + fba49e1 commit 560840c

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/otomi-stack.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node'
1+
import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node'
22
import Debug from 'debug'
33

44
import { getRegions, ObjectStorageKeyRegions } from '@linode/api-v4'
@@ -508,7 +508,9 @@ export default class OtomiStack {
508508
this.fileStore.set(filePath, aplObject)
509509

510510
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+
])
512514
return settings
513515
}
514516

@@ -603,7 +605,7 @@ export default class OtomiStack {
603605
this.fileStore.set(filePath, aplApp)
604606

605607
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`])
607609
return this.getApp(id)
608610
}
609611

@@ -636,7 +638,7 @@ export default class OtomiStack {
636638
if (aplRecords.length === 0) {
637639
throw new Error(`Failed toggling apps ${ids.toString()}`)
638640
}
639-
await this.doDeployments(aplRecords)
641+
await this.doDeployments(aplRecords, false)
640642
}
641643

642644
getTeams(): Array<Team> {
@@ -933,7 +935,7 @@ export default class OtomiStack {
933935

934936
async deleteNetpol(teamId: string, name: string): Promise<void> {
935937
const filePath = await this.deleteTeamConfigItem('AplTeamNetworkControl', teamId, name)
936-
await this.doDeleteDeployment([filePath], false)
938+
await this.doDeleteDeployment([filePath])
937939
}
938940

939941
getAllUsers(sessionUser: SessionUser): Array<User> {
@@ -1039,7 +1041,7 @@ export default class OtomiStack {
10391041
}
10401042

10411043
await this.deleteUserFile(id)
1042-
await this.doDeleteDeployment([filePath], false)
1044+
await this.doDeleteDeployment([filePath])
10431045
}
10441046

10451047
private canTeamAdminUpdateUserTeams(sessionUser: SessionUser, existingUser: User, updatedUserTeams: string[]) {
@@ -1197,7 +1199,7 @@ export default class OtomiStack {
11971199

11981200
async deleteCodeRepo(teamId: string, name: string): Promise<void> {
11991201
const filePath = await this.deleteTeamConfigItem('AplTeamCodeRepo', teamId, name)
1200-
await this.doDeleteDeployment([filePath], false)
1202+
await this.doDeleteDeployment([filePath])
12011203
}
12021204

12031205
async getRepoBranches(codeRepoName: string, teamId: string): Promise<string[]> {
@@ -1376,7 +1378,7 @@ export default class OtomiStack {
13761378

13771379
async deleteBuild(teamId: string, name: string): Promise<void> {
13781380
const filePath = await this.deleteTeamConfigItem('AplTeamBuild', teamId, name)
1379-
await this.doDeleteDeployment([filePath], false)
1381+
await this.doDeleteDeployment([filePath])
13801382
}
13811383

13821384
getTeamPolicies(teamId: string): Policies {
@@ -1710,7 +1712,7 @@ export default class OtomiStack {
17101712

17111713
async deleteWorkload(teamId: string, name: string): Promise<void> {
17121714
const filePath = await this.deleteTeamWorkload('AplTeamWorkload', teamId, name)
1713-
await this.doDeleteDeployment([filePath], false)
1715+
await this.doDeleteDeployment([filePath])
17141716
}
17151717

17161718
async editWorkloadValues(teamId: string, name: string, data: WorkloadValues): Promise<WorkloadValues> {
@@ -1812,7 +1814,7 @@ export default class OtomiStack {
18121814

18131815
async deleteService(teamId: string, name: string): Promise<void> {
18141816
const filePath = await this.deleteTeamConfigItem('AplTeamService', teamId, name)
1815-
await this.doDeleteDeployment([filePath], false)
1817+
await this.doDeleteDeployment([filePath])
18161818
}
18171819

18181820
checkPublicUrlInUse(teamId: string, service: AplServiceRequest): void {
@@ -1880,12 +1882,12 @@ export default class OtomiStack {
18801882
}
18811883
}
18821884

1883-
async doDeleteDeployment(filePaths: string[], encryptSecrets = true, files?: string[]): Promise<void> {
1885+
async doDeleteDeployment(filePaths: string[]): Promise<void> {
18841886
const rootStack = await getSessionStack()
18851887

18861888
try {
18871889
// Commit and push Git changes
1888-
await this.git.save(this.editor!, encryptSecrets, files)
1890+
await this.git.save(this.editor!, false)
18891891
// Pull the latest changes to ensure we have the most recent state
18901892
await rootStack.git.git.pull()
18911893

@@ -2137,7 +2139,7 @@ export default class OtomiStack {
21372139
async deleteSealedSecret(teamId: string, name: string): Promise<void> {
21382140
const filePath = this.fileStore.deleteTeamResource('AplTeamSecret', teamId, name)
21392141
await this.git.removeFile(filePath)
2140-
await this.doDeleteDeployment([filePath], false)
2142+
await this.doDeleteDeployment([filePath])
21412143
}
21422144

21432145
async getSealedSecret(teamId: string, name: string): Promise<SealedSecret> {
@@ -2220,7 +2222,7 @@ export default class OtomiStack {
22202222
const databasePath = getTeamDatabaseValuesFilePath(teamId, `${name}.yaml`)
22212223
await this.git.removeFile(relativePath)
22222224
await this.git.removeFile(databasePath)
2223-
await this.doDeleteDeployment([filePath], false)
2225+
await this.doDeleteDeployment([filePath])
22242226
}
22252227

22262228
async getAplKnowledgeBase(teamId: string, name: string): Promise<AplKnowledgeBaseResponse> {
@@ -2290,7 +2292,7 @@ export default class OtomiStack {
22902292
const filePath = this.fileStore.deleteTeamResource('AkamaiAgent', teamId, name)
22912293

22922294
await this.git.removeFile(filePath)
2293-
await this.doDeleteDeployment([filePath], false)
2295+
await this.doDeleteDeployment([filePath])
22942296
}
22952297

22962298
getAplAgent(teamId: string, name: string): AplAgentResponse {

0 commit comments

Comments
 (0)