Skip to content

Commit

Permalink
fix: use correct manifest loglevel in the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
stefreak committed Sep 15, 2023
1 parent f5fb8f8 commit 139b924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/src/plugins/kubernetes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ export const KUBECTL_RETRY_OPTS: RetryOpts = {
maxRetries: 3,
minTimeoutMs: 300,
// forceRetry is important, because shouldRetry cannot handle ChildProcessError.
forceRetry: true
forceRetry: true,
}

export async function getKubeConfig(log: Log, ctx: PluginContext, provider: KubernetesProvider) {
Expand All @@ -985,7 +985,7 @@ export async function getKubeConfig(log: Log, ctx: PluginContext, provider: Kube
log,
args,
}),
KUBECTL_RETRY_OPTS,
KUBECTL_RETRY_OPTS
)
}
return load(kubeConfigStr)!
Expand Down
7 changes: 4 additions & 3 deletions core/src/plugins/kubernetes/kubectl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export async function apply({

const input = Buffer.from(encodeYamlMulti(manifests))

log.debug(`Applying Kubernetes manifests:\n${input.toString()}`)
const manifestLogLevel = "debug" as const
log[manifestLogLevel](`Applying Kubernetes manifests:\n${input.toString()}`)

let args = ["apply"]
dryRun && args.push("--dry-run")
Expand All @@ -128,7 +129,7 @@ export async function apply({
args,
input,
}),
KUBECTL_RETRY_OPTS
KUBECTL_RETRY_OPTS
)
} catch (e) {
if (e instanceof ChildProcessError) {
Expand All @@ -138,7 +139,7 @@ export async function apply({
${e.details.output}
Use the option "--log-level verbose" to see the kubernetes manifests that we attempted to apply through "kubectl apply".
Use the option "--log-level ${manifestLogLevel}" to see the kubernetes manifests that we attempted to apply through "kubectl apply".
`,
})
}
Expand Down

0 comments on commit 139b924

Please sign in to comment.