Skip to content

feat: show kubectl context by default on startup - #10069

Open
majd102-p wants to merge 2 commits into
GoogleContainerTools:mainfrom
majd102-p:feat-show-kube-context-default
Open

feat: show kubectl context by default on startup#10069
majd102-p wants to merge 2 commits into
GoogleContainerTools:mainfrom
majd102-p:feat-show-kube-context-default

Conversation

@majd102-p

Copy link
Copy Markdown

Fixes: #6861

Related: N/A
Merge before/after: N/A

Description
This PR addresses issue #6861 by making the kubectl context and cluster information visible by default during startup. Previously, this information was only logged at the INFO level, requiring users to use -v info to see it.

The change ensures that users immediately know which context they are working with when running commands like skaffold dev or skaffold run, improving the overall developer experience.

User facing changes (remove if N/A)
The startup output now includes the current Kubernetes context:

Before: No context information was printed at the default log level.

After: Prints Using kubectl context: using the standard Skaffold output package.

Follow-up Work (remove if N/A)
N/A

@majd102-p
majd102-p requested a review from a team as a code owner April 24, 2026 20:13
@google-cla

google-cla Bot commented Apr 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the GetRunContext function in pkg/skaffold/runner/runcontext/context.go to output the current kubectl context using output.Default.Fprintf instead of a log entry. A review comment points out that using os.Stdout for this message can interfere with machine-readable output from commands like skaffold render and suggests redirecting the output to os.Stderr instead.

Comment thread pkg/skaffold/runner/runcontext/context.go Outdated
@majd102-p
majd102-p force-pushed the feat-show-kube-context-default branch from 09e9ad6 to 8e37a8c Compare April 24, 2026 20:49
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@majd102-p

Copy link
Copy Markdown
Author

Hi @GoogleContainerTools/skaffold-team,

I have updated the PR to use os.Stderr for the kubectl context output. This ensures the change remains non-breaking for machine-readable workflows (like skaffold render) while still addressing the visibility issue in #6861.

All CI prerequisites, including the CLA, are complete. Ready for a maintainer to trigger the workflows and review.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skaffold should output which kube-context + cluster is being used

1 participant