func RunCurrentContext(out io.Writer, options *CurrentContextOptions) error {
	config, err := options.ConfigAccess.GetStartingConfig()
	if err != nil {
		return err
	}
	if config.CurrentContext == "" {
		err = fmt.Errorf("current-context is not set")
		return err
	}
	fmt.Fprintf(out, "%s\n", config.CurrentContext)
	return nil
}
RunCurrentContext performs the execution of 'config current-context' sub command
package config
import (
	"fmt"
	"io"
	"github.com/spf13/cobra"
	"k8s.io/client-go/tools/clientcmd"
	cmdutil "k8s.io/kubectl/pkg/cmd/util"
	"k8s.io/kubectl/pkg/util/i18n"
	"k8s.io/kubectl/pkg/util/templates"
)
type CurrentContextOptions struct {
	ConfigAccess clientcmd.ConfigAccess
}
var (
	currentContextLong = templates.LongDesc(i18n.T(`
		Display the current-context.`))
	currentContextExample = templates.Examples(`
		# Display the current-context
		kubectl config current-context`)
)
func NewCmdConfigCurrentContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
	options := &CurrentContextOptions{ConfigAccess: configAccess}
	cmd := &cobra.Command{
		Use:     "current-context",
		Short:   i18n.T("Display the current-context"),
		Long:    currentContextLong,
		Example: currentContextExample,
		Run: func(cmd *cobra.Command, args []string) {
			cmdutil.CheckErr(RunCurrentContext(out, options))
		},
	}
	return cmd
}