Skip to content

Commit

Permalink
fix(k8s): don't include any hooks when checking resource statuses
Browse files Browse the repository at this point in the history
Fixed #1205
  • Loading branch information
edvald committed Sep 19, 2019
1 parent bc05b04 commit ca6462c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion garden-service/src/plugins/kubernetes/helm/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ export async function getChartResources(ctx: PluginContext, module: Module, log:

const resources = objects
.filter(obj => {
// Don't try to check status of hooks
const helmHook = getAnnotation(obj, "helm.sh/hook")
if (helmHook && helmHook.startsWith("test-")) {
if (helmHook) {
return false
}

// Ephemeral objects should also not be checked
if (obj.kind === "Pod" || obj.kind === "Job") {
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ describe("Helm common functions", () => {
expect(await getChartResources(ctx, module, log)).to.not.throw
})

it("should filter out test pods", async () => {
it("should filter out resources with hooks", async () => {
const module = await graph.getModule("chart-with-test-pod")
const resources = await getChartResources(ctx, module, log)

Expand Down

0 comments on commit ca6462c

Please sign in to comment.