Skip to content

Commit

Permalink
fix(core): potential edge-case issue with versions and generateFiles
Browse files Browse the repository at this point in the history
This is a little bit of a shot in the dark, looking to solve an issue
reported on Slack
(https://kubernetes.slack.com/archives/CKM7CP8P9/p1614599864049600), but
it's in any case a sane thing to do. Basically we now ensure that a new
tree scan is performed after manipulating files in a particular module
path.
  • Loading branch information
edvald authored and thsig committed Mar 18, 2021
1 parent d09e046 commit 7a74588
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/resolve-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import Bluebird from "bluebird"
import { readFile, mkdirp, writeFile } from "fs-extra"
import { LogEntry } from "./logger/log-entry"
import { ModuleConfigContext } from "./config/template-contexts/module"
import { pathToCacheContext } from "./cache"

// This limit is fairly arbitrary, but we need to have some cap on concurrent processing.
export const moduleResolutionConcurrencyLimit = 40
Expand Down Expand Up @@ -426,6 +427,12 @@ export class ModuleResolver {
}
})

// Make sure version is re-computed after writing files
if (!!resolvedConfig.generateFiles?.length) {
const cacheContext = pathToCacheContext(resolvedConfig.path)
this.garden.cache.invalidateUp(cacheContext)
}

const module = await moduleFromConfig(this.garden, this.log, resolvedConfig, dependencies)

const moduleTypeDefinitions = await this.garden.getModuleTypes()
Expand Down

0 comments on commit 7a74588

Please sign in to comment.