util

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package util contains code shared between the subcommands of crinit.

Index

Constants

View Source
const (
	APIServerCN = "clusterregistry"
	AdminCN     = "admin"
)

Variables

This section is empty.

Functions

func ArgMapsToArgStrings added in v0.0.2

func ArgMapsToArgStrings(argsMap, overrides map[string]string) []string

func AuthFileContents added in v0.0.2

func AuthFileContents(username, authSecret string) []byte

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 PrintSuccess(cmdOut io.Writer, ips, hostnames []string, svc *v1.Service) error

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.

type EntityKeyPairs added in v0.0.2

type EntityKeyPairs struct {
	CA     *triple.KeyPair
	Server *triple.KeyPair
	Admin  *triple.KeyPair
}

func GenCerts added in v0.0.2

func GenCerts(svcNamespace, name, svcName, localDNSZoneName string,
	ips, hostnames []string) (*EntityKeyPairs, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL