Skip to content

✨ feat(kube): add --print-path flag to cluster kubeconfig - #346

Merged
jfbus merged 1 commit into
mainfrom
print-path
Sep 21, 2026
Merged

jfbus merged 1 commit into
mainfrom
print-path

Conversation

@jfbus

@jfbus jfbus commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a --print-path flag to cluster kubeconfig.

This is implemented as a print-path formatter that caches the output to a file in ~/.cache and displays the path of the file.

It can be used on all commands but is only exposed/documented in cluster kubeconfig.

An alternative could have been to develop an ad-hoc kubeconfig command, using the same kubeconfig cached file as cluster kubectl. This solution was not used because:

  • it adds some complexity to the kubeconfig cache handling, considering that cluster kubeconfig has flags controlling the content of the kubeconfig (user, group, ttl),
  • caching the output of --print-path would break the contract with the user regarding ttl : a cached file from a previous run will never have the ttl that was requested by the user.

Type of Change

Please check the relevant option(s):

  • 🐛 Bug fix
  • ✨ New feature
  • 🧹 Code cleanup or refactor
  • 📝 Documentation update
  • 🔧 Build or CI-related change
  • 🔒 Security fix
  • Other (specify):

How Has This Been Tested?

Please describe the test strategy:

  • Manual testing
  • Unit tests
  • Integration tests
  • Not tested yet

Checklist

  • I have followed the Contributing Guidelines
  • I have added tests or explained why they are not needed
  • I have updated relevant documentation (README, examples, etc.)
  • My changes follow the Conventional Commits specification
  • My commits include appropriate Gitmoji

Additional Context

@github-actions

Copy link
Copy Markdown

WARNING : Differences in reference doc 🤔

 docs/reference/octl_kube_cluster_kubeconfig.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Detailed changes

docs/reference/octl_kube_cluster_kubeconfig.md

-      --ttl string     
+      --print-path     Print path to saved kubeconfig
+      --ttl string     TTL in human readable format (5h, 1d, 1w)

@github-actions github-actions Bot added the kind/feature New feature or request label Sep 17, 2026
@github-actions

Copy link
Copy Markdown

🔖 auto-tagging: Adding label "kind/feature"

@github-actions

Copy link
Copy Markdown

No flags have been deleted 😀

@github-actions

Copy link
Copy Markdown

Binary size: 82.3MB => 82.3MB (change +8KB, +0.0%) 😉

@jfbus
jfbus marked this pull request as ready for review September 17, 2026 17:26
@jfbus
jfbus requested a review from a team September 17, 2026 17:26
@jfbus
jfbus requested a review from a team as a code owner September 17, 2026 17:26
@jfbus
jfbus merged commit fe2d824 into main Sep 21, 2026
12 of 13 checks passed
@jfbus
jfbus deleted the print-path branch September 21, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature New feature or request

Development

Successfully merging this pull request may close these issues.

2 participants