Skip to content

Commit

Permalink
fix(k8s): missing stderr in verbose buildkit+kaniko build logs
Browse files Browse the repository at this point in the history
edvald authored and thsig committed Jun 24, 2021

Verified

This commit was signed with the committer’s verified signature.
purajit purajit
1 parent 2ad5e33 commit 2746fcf
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions core/src/plugins/kubernetes/container/build/buildkit.ts
Original file line number Diff line number Diff line change
@@ -107,11 +107,11 @@ export const buildkitBuildHandler: BuildHandler = async (params) => {
let buildLog = ""

// Stream debug log to a status line
const stdout = split2()
const outputStream = split2()
const statusLine = log.placeholder({ level: LogLevel.verbose })

stdout.on("error", () => {})
stdout.on("data", (line: Buffer) => {
outputStream.on("error", () => {})
outputStream.on("data", (line: Buffer) => {
statusLine.setState(renderOutputStream(line.toString()))
})

@@ -161,7 +161,8 @@ export const buildkitBuildHandler: BuildHandler = async (params) => {
command,
timeoutSec: buildTimeout,
containerName: buildkitContainerName,
stdout,
stdout: outputStream,
stderr: outputStream,
buffer: true,
})

9 changes: 5 additions & 4 deletions core/src/plugins/kubernetes/container/build/kaniko.ts
Original file line number Diff line number Diff line change
@@ -122,11 +122,11 @@ export const kanikoBuild: BuildHandler = async (params) => {
let buildLog = ""

// Stream debug log to a status line
const stdout = split2()
const outputStream = split2()
const statusLine = log.placeholder({ level: LogLevel.verbose })

stdout.on("error", () => {})
stdout.on("data", (line: Buffer) => {
outputStream.on("error", () => {})
outputStream.on("data", (line: Buffer) => {
statusLine.setState(renderOutputStream(line.toString()))
})

@@ -180,7 +180,7 @@ export const kanikoBuild: BuildHandler = async (params) => {
authSecretName: authSecret.metadata.name,
module,
args,
outputStream: stdout,
outputStream,
})

buildLog = buildRes.log
@@ -497,6 +497,7 @@ async function runKaniko({
remove: true,
timeoutSec: module.spec.build.timeout,
stdout: outputStream,
stderr: outputStream,
tty: false,
})

0 comments on commit 2746fcf

Please sign in to comment.