Skip to content

Commit

Permalink
improvement: removed some repetitive log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Jul 1, 2022
1 parent ae16f7b commit 3163961
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 0 additions & 5 deletions core/src/plugins/kubernetes/container/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ export async function startLocalMode({
return
}

log.warn({
section: service.name,
msg: chalk.grey(`Starting in local mode`),
})

const namespace = await getAppNamespace(ctx, log, ctx.provider)
const targetResource = status.detail.remoteResources.find((r) =>
hotReloadableKinds.includes(r.kind)
Expand Down
10 changes: 9 additions & 1 deletion core/src/plugins/kubernetes/local-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ async function getKubectlPortForwardProcess(
)
const { ctx, gardenService, log } = configParams

let lastSeenSuccessMessage = ""

return new RecoverableProcess({
osCommand: kubectlPortForwardCmd,
retryConfig: {
Expand Down Expand Up @@ -573,12 +575,18 @@ async function getKubectlPortForwardProcess(
hasErrors: (_chunk: any) => false,
onError: (_msg: ProcessMessage) => {},
onMessage: (msg: ProcessMessage) => {
const consoleMessage = composeMessage("Kubectl SSH port-forward is up and running", msg)
if (consoleMessage === lastSeenSuccessMessage) {
return
}

if (msg.message.includes("Handling connection for")) {
log.info({
status: "success",
section: gardenService.name,
msg: chalk.white(composeMessage("Kubectl SSH port-forward is up and running", msg)),
msg: chalk.white(consoleMessage),
})
lastSeenSuccessMessage = consoleMessage
}
},
},
Expand Down

0 comments on commit 3163961

Please sign in to comment.