Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

1.4 – Column support

Compare
Choose a tag to compare
@Mikulas Mikulas released this 08 Jul 08:49
· 15 commits to master since this release

Changes since last stable release (1.1):

  • Added indexed variables. Now it's possible to access all columns in the output.
    • The syntax is $var:index, eg $1:2` to access the second column of first variable.
    • The main short syntax $var still works (and will always work). It defaults to $var:1.
    • This is meant mostly for non-standard output, such as --all-namespaces which puts namespace on the first column and unique resource name on the second column.
# beta kube-system get pods --all-namespaces
  	NAMESPACE        NAME                READY STATUS   RESTARTS  AGE
$1 	kube-monitoring  logspout-ds-9l4pw   1/1   Running  36        4d
$2 	kube-monitoring  logspout-ds-b2pws   1/1   Running  9         3d
$3 	kube-monitoring  logspout-ds-gs4nv   1/1   Running  0         4d
# beta kube-system ; echo $1
kube-monitoring
# beta kube-system ; echo $1:2
logspout-ds-9l4pw
  • Support for cluster switching #3
    • A new -context=string flag was introduced, which passed the context to all invoked kubectl commands. This greatly simplifies managing multiple clusters: an operator can have multiple shells opened at once with different contexts.
    • Example usage: ./kubectl-repl -context=beta
  • GCP / GKE Not supported #8
    • Repl wrapped every command around kubectl, but namespace selector communicated directly with the cluster through the golang SDK. In 2830fe3 this was refactored to also use kubectl. This solves many issues, including authentication and state persistence with KUBECONFIG.
  • If machine output is detected (json, yaml), lines are not prefixed and saved to variables. Same with --help.
  • Similarity matching fixes.
  • Added autocomplete dictionary to Docker rlwrap.

Complete changelog since the previous release: 1.1...1.4

This release is also available as a Docker image:
https://hub.docker.com/r/mikulas/kubectl-repl/