Documentation
¶
Index ¶
Constants ¶
const ( PortFlagName = "port" DCP_SECURE_TOKEN = "DCP_SECURE_TOKEN" )
const (
PlaceholderToken = "<placeholder>"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureKubeconfigFlag ¶
controller-runtime expects --kubeconfig flag to be registered with the default flag.CommandLine flag set, see https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/config/config.go for details. Instead of registering the flag ourselves, we will call controller-runtime RegisterFlags() function, then look it up and return.
Types ¶
type Kubeconfig ¶
type Kubeconfig struct {
Config *clientcmd_api.Config
// contains filtered or unexported fields
}
func EnsureKubeconfigData ¶
Creates API server addressing and authentication data that will go into the kubeconfig file. The kubeconfig flag value, if empty upon invocation, will be set to preferred path of the kubeconfig file. Does NOT create the kubeconfig file itself (see Kubeconfig.Save() for that).
func (*Kubeconfig) GetData ¶
func (k *Kubeconfig) GetData() (net.IP, int, string, *security.ServerCertificateData, error)
Reads Kubeconfig data and returns the address, port and security token of the current context, to be used to configure/connect to API server
func (*Kubeconfig) Path ¶
func (k *Kubeconfig) Path() string
func (*Kubeconfig) Save ¶
func (k *Kubeconfig) Save() error
Write the kubeconfig data if it doesn't exist. Will not update an existing kubeconfig.