mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Use dedent for the kubectl commands
The one side effect is that for the "kubectl help" commands a newline is prepended to output, which will alter the yaml output. Here we use dedent to format the code to match the output. hack/update-generated-docs.sh has been run and the affected files have been added. Note: for describe.go we added a period to the end of an output message.
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/renstrom/dedent"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
||||
@@ -39,15 +40,17 @@ type ViewOptions struct {
|
||||
RawByteData bool
|
||||
}
|
||||
|
||||
const (
|
||||
view_long = `Displays merged kubeconfig settings or a specified kubeconfig file.
|
||||
var (
|
||||
view_long = dedent.Dedent(`
|
||||
Displays merged kubeconfig settings or a specified kubeconfig file.
|
||||
|
||||
You can use --output jsonpath={...} to extract specific values using a jsonpath expression.`
|
||||
view_example = `# Show Merged kubeconfig settings.
|
||||
kubectl config view
|
||||
You can use --output jsonpath={...} to extract specific values using a jsonpath expression.`)
|
||||
view_example = dedent.Dedent(`
|
||||
# Show Merged kubeconfig settings.
|
||||
kubectl config view
|
||||
|
||||
# Get the password for the e2e user
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'`
|
||||
# Get the password for the e2e user
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'`)
|
||||
)
|
||||
|
||||
func NewCmdConfigView(out io.Writer, ConfigAccess clientcmd.ConfigAccess) *cobra.Command {
|
||||
|
||||
Reference in New Issue
Block a user