Skip to content

Commit 9e240c7

Browse files
authored
fix: attempt to migrate values on every operator cycle (#2807)
1 parent fdf7a4d commit 9e240c7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/operator/apl-operator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ describe('AplOperator', () => {
212212
expect(mockAplOps.applyAsAppsTeams).toHaveBeenCalled()
213213
expect(mockAplOps.apply).not.toHaveBeenCalled()
214214
})
215-
test('should not run migrate and validate when run is reconcile', async () => {
215+
test('should run migrate and but not validate when run is reconcile', async () => {
216216
Object.defineProperty(aplOperator, 'isApplying', { value: false, configurable: true })
217217

218218
await aplOperator.runApplyIfNotBusy(ApplyTrigger.Reconcile, false)
219219

220220
expect(mockAplOps.apply).toHaveBeenCalled()
221-
expect(mockAplOps.migrate).not.toHaveBeenCalled()
221+
expect(mockAplOps.migrate).toHaveBeenCalled()
222222
expect(mockAplOps.validateValues).not.toHaveBeenCalled()
223223
})
224224

src/operator/apl-operator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ export class AplOperator {
7575
this.d.info('Write default values to env repo')
7676
await writeValues(defaultValues)
7777

78+
await this.aplOps.migrate()
7879
if (trigger === ApplyTrigger.Poll) {
79-
await this.aplOps.migrate()
80-
8180
this.d.info(`[${trigger}] Starting validation process`)
8281
await this.aplOps.validateValues()
8382
this.d.info(`[${trigger}] Validation process completed`)

0 commit comments

Comments
 (0)