Change kubectl help/examples to use jsonpath instead of template

This commit is contained in:
Jeff Lowdermilk 2015-12-09 11:27:54 -08:00
parent 282b9eebb8
commit 734a8c0602
4 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ kubectl config view \- Displays merged kubeconfig settings or a specified kubeco
Displays merged kubeconfig settings or a specified kubeconfig file. Displays merged kubeconfig settings or a specified kubeconfig file.
.PP .PP
You can use \-\-output=template \-\-template=TEMPLATE to extract specific values. You can use \-\-output jsonpath={...} to extract specific values using a jsonpath expression.
.SH OPTIONS .SH OPTIONS
@ -167,7 +167,7 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values
$ kubectl config view $ kubectl config view
# Get the password for the e2e user # Get the password for the e2e user
$ kubectl config view \-o template \-\-template='{{range .users}}{{ if eq .name "e2e" }}{{ index .user.password }}{{end}}{{end}}' $ kubectl config view \-o jsonpath='{.users[?(@.name == "e2e")].user.password}'
.fi .fi
.RE .RE

View File

@ -41,7 +41,7 @@ Displays merged kubeconfig settings or a specified kubeconfig file.
Displays merged kubeconfig settings or a specified kubeconfig file. Displays merged kubeconfig settings or a specified kubeconfig file.
You can use --output=template --template=TEMPLATE to extract specific values. You can use --output jsonpath={...} to extract specific values using a jsonpath expression.
``` ```
kubectl config view kubectl config view
@ -54,7 +54,7 @@ kubectl config view
$ kubectl config view $ kubectl config view
# Get the password for the e2e user # Get the password for the e2e user
$ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2e" }}{{ index .user.password }}{{end}}{{end}}' $ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
``` ```
### Options ### Options
@ -104,7 +104,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra on 8-Jan-2016 ###### Auto generated by spf13/cobra on 28-Jan-2016
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()

View File

@ -42,12 +42,12 @@ type ViewOptions struct {
const ( const (
view_long = `Displays merged kubeconfig settings or a specified kubeconfig file. view_long = `Displays merged kubeconfig settings or a specified kubeconfig file.
You can use --output=template --template=TEMPLATE to extract specific values.` You can use --output jsonpath={...} to extract specific values using a jsonpath expression.`
view_example = `# Show Merged kubeconfig settings. view_example = `# Show Merged kubeconfig settings.
$ kubectl config view $ kubectl config view
# Get the password for the e2e user # Get the password for the e2e user
$ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2e" }}{{ index .user.password }}{{end}}{{end}}'` $ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'`
) )
func NewCmdConfigView(out io.Writer, ConfigAccess ConfigAccess) *cobra.Command { func NewCmdConfigView(out io.Writer, ConfigAccess ConfigAccess) *cobra.Command {