Skip to content

Commit

Permalink
fix(k8s): include value files in default Helm include clause
Browse files Browse the repository at this point in the history
  • Loading branch information
10ko authored and edvald committed Feb 25, 2020
1 parent 5180604 commit 2427805
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion garden-service/src/plugins/kubernetes/helm/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,13 @@ export async function configureHelmModule({
"release-name": getReleaseName(moduleConfig),
}

const valueFiles = moduleConfig.spec.valueFiles

// Automatically set the include if not explicitly set
if (!(moduleConfig.include || moduleConfig.exclude)) {
moduleConfig.include = containsSources ? ["*", "charts/**/*", "templates/**/*"] : []
moduleConfig.include = containsSources
? ["*", "charts/**/*", "templates/**/*", ...valueFiles]
: ["*.yaml", "*.yml", ...valueFiles]
}

return { moduleConfig }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ describe("configureHelmModule", () => {
expect(configExclude.include).to.be.undefined
})

it("should set include to empty if module does not have local chart sources", async () => {
it("should set include to default if module does not have local chart sources", async () => {
// So that Chart.yaml isn't found
patchModuleConfig("api", { spec: { chartPath: "invalid-path" } })
const config = await garden.resolveModuleConfig(garden.log, "api")
expect(config.include).to.eql([])
expect(config.include).to.eql(["*.yaml", "*.yml"])
})

it("should not return a serviceConfig if skipDeploy=true", async () => {
Expand Down

0 comments on commit 2427805

Please sign in to comment.