Documentation
¶
Overview ¶
Package util contains code shared between the subcommands of crinit.
Index ¶
- Constants
- func ArgMapsToArgStrings(argsMap, overrides map[string]string) []string
- func AuthFileContents(username, authSecret string) []byte
- func GetCAKeyPair(credentials *Credentials) *triple.KeyPair
- func GetClientConfig(pathOptions *clientcmd.PathOptions, context, kubeconfigPath string) clientcmd.ClientConfig
- func PrintSuccess(cmdOut io.Writer, ips, hostnames []string, svc *v1.Service) error
- func UpdateKubeconfig(pathOptions *clientcmd.PathOptions, name, endpoint, kubeConfigPath string, ...) error
- type Credentials
- type EntityKeyPairs
Constants ¶
View Source
const ( APIServerCN = "clusterregistry" AdminCN = "admin" )
Variables ¶
This section is empty.
Functions ¶
func ArgMapsToArgStrings ¶ added in v0.0.2
func AuthFileContents ¶ added in v0.0.2
AuthFileContents returns a CSV string containing the contents of an authentication file in the format required by the cluster registry.
func GetCAKeyPair ¶
func GetCAKeyPair(credentials *Credentials) *triple.KeyPair
GetCAKeyPair retrieves the CA key pair stored in the internal credentials structure.
func GetClientConfig ¶
func GetClientConfig(pathOptions *clientcmd.PathOptions, context, kubeconfigPath string) clientcmd.ClientConfig
GetClientConfig gets a ClientConfig for the proivided context in kubeconfig file referenced by kubeconfigPath.
func PrintSuccess ¶ added in v0.0.2
func UpdateKubeconfig ¶ added in v0.0.2
func UpdateKubeconfig(pathOptions *clientcmd.PathOptions, name, endpoint, kubeConfigPath string, credentials *Credentials, dryRun bool) error
UpdateKubeconfig helper to update the kubeconfig file based on input parameters.
Types ¶
type Credentials ¶
type Credentials struct {
Username string
Password string
Token string
CertEntKeyPairs *EntityKeyPairs
}
func GenerateCredentials ¶ added in v0.0.2
func GenerateCredentials(svcNamespace, name, svcName, localDNSZoneName string, ips, hostnames []string, enableHTTPBasicAuth, enableTokenAuth bool) (*Credentials, error)
generateCredentials helper to create the certs for the apiserver.
Click to show internal directories.
Click to hide internal directories.