Skip to content

Commit 4a4aeb4

Browse files
authored
fix: sanitize error message in git repository initialization (#770)
1 parent 1b94c75 commit 4a4aeb4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/otomi-stack.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CoreV1Api, User as k8sUser, KubeConfig, V1ObjectReference } from '@kubernetes/client-node'
1+
import { CoreV1Api, KubeConfig, User as k8sUser, V1ObjectReference } from '@kubernetes/client-node'
22
import Debug from 'debug'
33

44
import { getRegions, ObjectStorageKeyRegions } from '@linode/api-v4'
@@ -315,8 +315,8 @@ export default class OtomiStack {
315315
debug(`Values are not present at ${url}:${branch}`)
316316
} catch (e) {
317317
// Remove password from error message
318-
const safeCommand = JSON.stringify(e.task?.commands).replace(env.GIT_PASSWORD, '****')
319-
debug(`${e.message.trim()} for command ${JSON.stringify(safeCommand)}`)
318+
const errorMessage = getSanitizedErrorMessage(e)
319+
debug(`Error while initializing git repository: ${errorMessage}`)
320320
debug(`Git repository is not ready: ${url}:${branch}`)
321321
}
322322
const timeoutMs = 10000

0 commit comments

Comments
 (0)