Skip to content

Commit

Permalink
fix(kubernetes): make preStop command work with busybox (#3568)
Browse files Browse the repository at this point in the history
* fix(kubernetes): make preStop command work with busybox

The pgrep -c option does not exist in busybox. Make the preStop command more portable.

This avoids a weird error message in the logs of Garden Pods including the util container.
  • Loading branch information
stefreak authored and vvagaytsev committed Mar 6, 2023
1 parent 89b55d3 commit 4aa0141
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/kubernetes/container/build/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ export function getUtilContainer(authSecretName: string, provider: KubernetesPro
command: [
"/bin/sh",
"-c",
"until test $(pgrep -fc '^[^ ]+rsync') = 1; do echo waiting for rsync to finish...; sleep 1; done",
"until test $(pgrep -f '^[^ ]+rsync' | wc -l) = 1; do echo waiting for rsync to finish...; sleep 1; done",
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe("buildkit build", () => {
command: [
"/bin/sh",
"-c",
"until test $(pgrep -fc '^[^ ]+rsync') = 1; do echo waiting for rsync to finish...; sleep 1; done",
"until test $(pgrep -f '^[^ ]+rsync' | wc -l) = 1; do echo waiting for rsync to finish...; sleep 1; done",
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("common build", () => {
command: [
"/bin/sh",
"-c",
"until test $(pgrep -fc '^[^ ]+rsync') = 1; do echo waiting for rsync to finish...; sleep 1; done",
"until test $(pgrep -f '^[^ ]+rsync' | wc -l) = 1; do echo waiting for rsync to finish...; sleep 1; done",
],
},
},
Expand Down

0 comments on commit 4aa0141

Please sign in to comment.