Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: add additional info to error message when sh is not found #3980

Merged
merged 3 commits into from Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion core/src/plugins/kubernetes/run.ts
Expand Up @@ -550,7 +550,10 @@ async function runWithArtifacts({
deline`
${description} specifies artifacts to export, but the image doesn't
contain the sh binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need to
be installed in the image.`,
be installed in the image.

Original error message:
${message}`,
errorMetadata
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions core/test/integ/src/plugins/kubernetes/container/container.ts
Expand Up @@ -339,7 +339,7 @@ describe("kubernetes container module handlers", () => {
const key = "test.missing-sh.missing-sh-test"
expect(result).to.have.property(key)
expect(result[key]!.error).to.exist
expect(result[key]!.error!.message).to.equal(deline`
expect(result[key]!.error!.message).to.include(deline`
Test 'missing-sh-test' in container module 'missing-sh' specifies artifacts to export, but the image doesn't
contain the sh binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need
to be installed in the image.
Expand All @@ -366,7 +366,7 @@ describe("kubernetes container module handlers", () => {
const key = "test.missing-tar.missing-tar-test"
expect(result).to.have.property(key)
expect(result[key]!.error).to.exist
expect(result[key]!.error!.message).to.equal(deline`
expect(result[key]!.error!.message).to.include(deline`
Test 'missing-tar-test' in container module 'missing-tar' specifies artifacts to export, but the
image doesn't contain the tar binary. In order to copy artifacts out of Kubernetes containers, both
sh and tar need to be installed in the image.
Expand Down
4 changes: 2 additions & 2 deletions core/test/integ/src/plugins/kubernetes/container/run.ts
Expand Up @@ -237,7 +237,7 @@ describe("runContainerTask", () => {

expect(result).to.have.property(key)
expect(result[key]!.error).to.exist
expect(result[key]!.error!.message).to.equal(deline`
expect(result[key]!.error!.message).to.include(deline`
Task 'missing-sh-task' in container module 'missing-sh' specifies artifacts to export, but the image doesn't
contain the sh binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need
to be installed in the image.
Expand Down Expand Up @@ -265,7 +265,7 @@ describe("runContainerTask", () => {

expect(result).to.have.property(key)
expect(result[key]!.error).to.exist
expect(result[key]!.error!.message).to.equal(deline`
expect(result[key]!.error!.message).to.include(deline`
Task 'missing-tar-task' in container module 'missing-tar' specifies artifacts to export, but the image doesn't
contain the tar binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need
to be installed in the image.
Expand Down
6 changes: 3 additions & 3 deletions core/test/integ/src/plugins/kubernetes/run.ts
Expand Up @@ -1260,7 +1260,7 @@ describe("kubernetes Pod runner functions", () => {
version: module.version.versionString,
}),
(err) =>
expect(err.message).to.equal(deline`
expect(err.message).to.include(deline`
Foo specifies artifacts to export, but the image doesn't
contain the sh binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need
to be installed in the image.
Expand Down Expand Up @@ -1300,7 +1300,7 @@ describe("kubernetes Pod runner functions", () => {
version: module.version.versionString,
}),
(err) =>
expect(err.message).to.equal(deline`
expect(err.message).to.include(deline`
Foo specifies artifacts to export, but the image doesn't
contain the tar binary. In order to copy artifacts out of Kubernetes containers, both sh and tar need
to be installed in the image.
Expand Down Expand Up @@ -1329,7 +1329,7 @@ describe("kubernetes Pod runner functions", () => {
version: module.version.versionString,
}),
(err) =>
expect(err.message).to.equal(deline`
expect(err.message).to.include(deline`
Foo specifies artifacts to export, but doesn't explicitly set a \`command\`.
The kubernetes provider currently requires an explicit command to be set for tests and tasks that
export artifacts, because the image's entrypoint cannot be inferred in that execution mode.
Expand Down