package util

import "k8s.io/client-go/tools/bootstrap/token/util"

Index

Variables

var (
	// BootstrapTokenRegexp is a compiled regular expression of TokenRegexpString
	BootstrapTokenRegexp = regexp.MustCompile(api.BootstrapTokenPattern)
	// BootstrapTokenIDRegexp is a compiled regular expression of TokenIDRegexpString
	BootstrapTokenIDRegexp = regexp.MustCompile(api.BootstrapTokenIDPattern)
	// BootstrapGroupRegexp is a compiled regular expression of BootstrapGroupPattern
	BootstrapGroupRegexp = regexp.MustCompile(api.BootstrapGroupPattern)
)

Functions

func BootstrapTokenSecretName

func BootstrapTokenSecretName(tokenID string) string

BootstrapTokenSecretName returns the expected name for the Secret storing the Bootstrap Token in the Kubernetes API.

func GenerateBootstrapToken

func GenerateBootstrapToken() (string, error)

GenerateBootstrapToken generates a new, random Bootstrap Token.

func IsValidBootstrapToken

func IsValidBootstrapToken(token string) bool

IsValidBootstrapToken returns whether the given string is valid as a Bootstrap Token and in other words satisfies the BootstrapTokenRegexp

func IsValidBootstrapTokenID

func IsValidBootstrapTokenID(tokenID string) bool

IsValidBootstrapTokenID returns whether the given string is valid as a Bootstrap Token ID and in other words satisfies the BootstrapTokenIDRegexp

func TokenFromIDAndSecret

func TokenFromIDAndSecret(id, secret string) string

TokenFromIDAndSecret returns the full token which is of the form "{id}.{secret}"

func ValidateBootstrapGroupName

func ValidateBootstrapGroupName(name string) error

ValidateBootstrapGroupName checks if the provided group name is a valid bootstrap group name. Returns nil if valid or a validation error if invalid.

func ValidateUsages

func ValidateUsages(usages []string) error

ValidateUsages validates that the passed in string are valid usage strings for bootstrap tokens.

Source Files

helpers.go

Version
v9.0.0-invalid+incompatible
Published
Sep 27, 2018
Platform
js/wasm
Imports
7 packages
Last checked
1 minute ago

Tools for package owners.