Documentation ¶
Overview ¶
Package helpers provides general purpose utility methods that are used throughout aks-engine codebase.
Index ¶
- Constants
- Variables
- func AcceleratedNetworkingSupported(sku string) bool
- func CreatePki(pkiParams PkiParams) (*PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, ...)
- func CreateSSH(rg io.Reader, s *i18n.Translator) (privateKey *rsa.PrivateKey, publicKeyString string, err error)
- func CreateSaveSSH(username, outputDirectory string, s *i18n.Translator) (privateKey *rsa.PrivateKey, publicKeyString string, err error)
- func EnsureString(val, defaultVal string) string
- func EqualError(a, b error) bool
- func GetAzureLocations() []string
- func GetCloudTargetEnv(location string) string
- func GetEnglishOrderedQuotedListWithOxfordCommas(l []string) string
- func GetHomeDir() string
- func GetKubernetesAllowedVMSKUs() string
- func GetLogAnalyticsWorkspaceDomain(cloudOrDependenciesLocation string) string
- func GetSizeMap() string
- func GetTargetEnv(location, customCloudName string) string
- func IsFalseBoolPointer(b *bool) bool
- func IsTrueBoolPointer(b *bool) bool
- func JSONMarshal(content interface{}, escape bool) ([]byte, error)
- func JSONMarshalIndent(content interface{}, prefix, indent string, escape bool) ([]byte, error)
- func NormalizeAzureRegion(name string) string
- func PointerToBool(b bool) *bool
- func PointerToInt(i int) *int
- func PointerToString(s string) *string
- func PublicKeyAuth(sshPrivateKeyPath string) (ssh.AuthMethod, error)
- func SSHClient(jumpboxHost, jumpboxPort, hostname string, ...) (*ssh.Client, error)
- func SSHClientConfig(user string, auth ssh.AuthMethod) *ssh.ClientConfig
- func ShellQuote(s string) string
- type FileSaver
- type PkiKeyCertPair
- type PkiKeyCertPairParams
- type PkiParams
- type VMSku
Constants ¶
const ( // SSHKeySize is the size (in bytes) of SSH key to create SSHKeySize = 4096 // DefaultPkiKeySize is the default size in bytes of the PKI key DefaultPkiKeySize = 4096 )
const ( // ValidityDuration specifies the duration an TLS certificate is valid ValidityDuration = time.Hour * 24 * 365 * 30 )
Variables ¶
var VMSkus = []VMSku{}/* 462 elements not displayed */
Functions ¶
func AcceleratedNetworkingSupported ¶
AcceleratedNetworkingSupported checks if the VM SKU supports Accelerated Networking.
func CreatePki ¶
func CreatePki(pkiParams PkiParams) (*PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, *PkiKeyCertPair, []*PkiKeyCertPair, error)
CreatePki creates PKI certificates
func CreateSSH ¶
func CreateSSH(rg io.Reader, s *i18n.Translator) (privateKey *rsa.PrivateKey, publicKeyString string, err error)
CreateSSH creates an SSH key pair.
func CreateSaveSSH ¶
func CreateSaveSSH(username, outputDirectory string, s *i18n.Translator) (privateKey *rsa.PrivateKey, publicKeyString string, err error)
CreateSaveSSH generates and stashes an SSH key pair.
func EnsureString ¶ added in v0.31.0
EnsureString returns an string for the default value. If val is not empty, return val If val is empty, return defaultVal
func EqualError ¶
EqualError is a nil-safe method which reports whether errors a and b are considered equal. They're equal if both are nil, or both are not nil and a.Error() == b.Error().
func GetAzureLocations ¶
func GetAzureLocations() []string
GetAzureLocations provides all available Azure cloud locations.
Code generated for package helpers by aks-engine DO NOT EDIT. (@generated)
To generate this code, run the command:
aks-engine get-locations --output=code
func GetCloudTargetEnv ¶
GetCloudTargetEnv determines and returns whether the region is a sovereign cloud which have their own data compliance regulations (China/Germany/USGov) or standard Azure public cloud
func GetEnglishOrderedQuotedListWithOxfordCommas ¶ added in v0.49.0
GetEnglishOrderedQuotedListWithOxfordCommas returns a string that you can use in an English statement to report a list of things With each thing in quotes, e.g. "thing 1", "thing 2", and "thing 3" Oxford Comma not optional!
func GetKubernetesAllowedVMSKUs ¶ added in v0.37.0
func GetKubernetesAllowedVMSKUs() string
GetKubernetesAllowedVMSKUs returns the allowed sizes for Kubernetes agent
func GetLogAnalyticsWorkspaceDomain ¶ added in v0.43.0
get domain of azure log analytics workspace based on the cloud or azure stack dependenciesLocation
func GetTargetEnv ¶ added in v0.31.0
GetTargetEnv determines and returns whether the region is a sovereign cloud which have their own data compliance regulations (China/Germany/USGov) or standard Azure public cloud CustomCloudName is name of environment if customCloudProfile is provided, it will be empty string if customCloudProfile is empty. Because customCloudProfile is empty for deployment for AzurePublicCloud, AzureChinaCloud,AzureGermanCloud,AzureUSGovernmentCloud, The customCloudName value will be empty string for those clouds This value is also used in azure.json file, which is used by Kubernetes to read various endpoints specific to cloud
func IsFalseBoolPointer ¶
IsFalseBoolPointer is a simple boolean helper function for boolean pointers
func IsTrueBoolPointer ¶
IsTrueBoolPointer is a simple boolean helper function for boolean pointers
func JSONMarshal ¶
JSONMarshal marshals JSON w/ optional SetEscapeHTML
func JSONMarshalIndent ¶
JSONMarshalIndent marshals formatted JSON w/ optional SetEscapeHTML
func NormalizeAzureRegion ¶
NormalizeAzureRegion returns a normalized Azure region with white spaces removed and converted to lower case
func PointerToString ¶
PointerToString returns a pointer to a string
func PublicKeyAuth ¶ added in v0.50.0
func PublicKeyAuth(sshPrivateKeyPath string) (ssh.AuthMethod, error)
func SSHClientConfig ¶ added in v0.50.0
func SSHClientConfig(user string, auth ssh.AuthMethod) *ssh.ClientConfig
func ShellQuote ¶
ShellQuote returns a string that is enclosed within single quotes. If the string already has single quotes, they will be escaped.
Types ¶
type FileSaver ¶
type FileSaver struct {
Translator *i18n.Translator
}
FileSaver represents the object that save string or byte data to file
type PkiKeyCertPair ¶
PkiKeyCertPair represents an PKI public and private cert pair
func CreatePkiKeyCertPair ¶
func CreatePkiKeyCertPair(params PkiKeyCertPairParams) (*PkiKeyCertPair, error)
CreatePkiKeyCertPair generates a pair of PKI certificate and private key
type PkiKeyCertPairParams ¶ added in v0.41.0
PkiKeyCertPairParams is the params when we create the pki key cert pair.