package util
import "k8s.io/kubernetes/cmd/kubeadm/app/util"
Index ¶
- Constants
- Variables
- func BehaviorOnFatal(f func(string, int))
- func CheckErr(err error)
- func CreateBasicClientConfig(clusterName string, serverURL string, caCert []byte) *clientcmdapi.Config
- func GenerateToken(s *kubeadmapi.Secrets) error
- func MakeClientConfigWithCerts(config *clientcmdapi.Config, clusterName string, userName string, clientKey []byte, clientCert []byte) *clientcmdapi.Config
- func MakeClientConfigWithToken(config *clientcmdapi.Config, clusterName string, userName string, token string) *clientcmdapi.Config
- func RandBytes(length int) ([]byte, string, error)
- func UseGivenTokenIfValid(s *kubeadmapi.Secrets) (bool, error)
- func WriteKubeconfigIfNotExists(name string, kubeconfig *clientcmdapi.Config) error
Constants ¶
const ( DefaultErrorExitCode = 1 PreFlight = 2 )
const ( TokenIDLen = 6 TokenBytes = 8 )
Variables ¶
Functions ¶
func BehaviorOnFatal ¶
BehaviorOnFatal allows you to override the default behavior when a fatal error occurs, which is to call os.Exit(code). You can pass 'panic' as a function here if you prefer the panic() over os.Exit(1).
func CheckErr ¶
func CheckErr(err error)
CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. Unrecognized errors will be printed with an "error: " prefix.
This method is generic to the command in use and may be used by non-Kubectl commands.
func CreateBasicClientConfig ¶
func CreateBasicClientConfig(clusterName string, serverURL string, caCert []byte) *clientcmdapi.Config
func GenerateToken ¶
func GenerateToken(s *kubeadmapi.Secrets) error
func MakeClientConfigWithCerts ¶
func MakeClientConfigWithCerts(config *clientcmdapi.Config, clusterName string, userName string, clientKey []byte, clientCert []byte) *clientcmdapi.Config
func MakeClientConfigWithToken ¶
func MakeClientConfigWithToken(config *clientcmdapi.Config, clusterName string, userName string, token string) *clientcmdapi.Config
func RandBytes ¶
func UseGivenTokenIfValid ¶
func UseGivenTokenIfValid(s *kubeadmapi.Secrets) (bool, error)
func WriteKubeconfigIfNotExists ¶
func WriteKubeconfigIfNotExists(name string, kubeconfig *clientcmdapi.Config) error
Source Files ¶
error.go kubeconfig.go tokens.go
- Version
- v1.5.6
- Published
- Mar 28, 2017
- Platform
- js/wasm
- Imports
- 12 packages
- Last checked
- 11 minutes ago –
Tools for package owners.