Documentation ¶
Index ¶
- func AppendDotFlatMapKeyFormatter(path, newPart string) string
- func ApplyCmdWithError(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command
- func CapitalizeUnderscoreFlatMapKeyFormatter(path, newPart string) string
- func GetBearerToken(in *restclient.Config, explicitKubeConfigPath string, ...) (token string, username string, err error)
- func GetDeployedWebURL(yamlFile *DynamicYaml) (string, error)
- func GetWildCardDNS(url string) string
- func GetYamlStringValue(mapping map[string]interface{}, key string) (*string, error)
- func IsApplicationControllerManagerRunning(c *kubernetes.Clientset) (bool, error)
- func IsIpv4(host string) bool
- func KubectlApply(filePath string) (err error)
- func KubectlDelete(filePath string) (err error)
- func KubectlGet(resource string, resourceName string, namespace string, extraArgs []string, ...) (stdout string, stderr string, err error)
- func KubectlPatch(namespace string, resource string, filePath string) (err error)
- func ListOnepanelEnabledNamespaces(c *kubernetes.Clientset) (namespaces []string, err error)
- func LowerCamelCaseFlatMapKeyFormatter(path, newPart string) string
- func LowerCamelCaseStringFormat(value, separator string) string
- func NamespacesExist(c *kubernetes.Clientset, namespaces ...string) (bool, error)
- func NamespacesToCheck(yamlFile *DynamicYaml) []string
- func NewKubernetesClient() (*kubernetes.Clientset, error)
- func NodeValueToActual(node *yaml.Node) (interface{}, error)
- func PrintClusterNetworkInformation(c *kubernetes.Clientset, url string)
- func RandASCIIBytes(n int) ([]byte, error)
- func RandASCIIString(n int) (string, error)
- func RefreshAuthToken(in *restclient.Config) error
- func RefreshTokenIfExpired(restConfig *restclient.Config, explicitPath, curentToken string) (string, error)
- func ReloadKubeConfig(explicitPath string) clientcmd.ClientConfig
- type Config
- type DynamicYaml
- func (d *DynamicYaml) Delete(key string) error
- func (d *DynamicYaml) DeleteByParts(parts ...string) error
- func (d *DynamicYaml) DeleteByString(key, separator string) error
- func (d *DynamicYaml) FindMissingKeys(keys ...string) []string
- func (d *DynamicYaml) Flatten(keyFormatter FlatMapKeyFormatter) map[string]NodePair
- func (d *DynamicYaml) FlattenRequiredDefault()
- func (d *DynamicYaml) FlattenToKeyValue(keyFormatter FlatMapKeyFormatter) map[string]interface{}
- func (d *DynamicYaml) Get(key string) (keyNode, value *yaml.Node)
- func (d *DynamicYaml) GetByParts(parts ...string) (key, value *yaml.Node)
- func (d *DynamicYaml) GetValue(key string) (value *yaml.Node)
- func (d *DynamicYaml) GetValueByParts(parts ...string) (value *yaml.Node)
- func (d *DynamicYaml) GetValueWithSeparator(key, separator string) (value *yaml.Node)
- func (d *DynamicYaml) GetWithSeparator(key, separator string) (keyNode, value *yaml.Node)
- func (d *DynamicYaml) HasKey(key string) bool
- func (d *DynamicYaml) HasKeys(keys ...string) bool
- func (d *DynamicYaml) Merge(items ...*DynamicYaml)
- func (d *DynamicYaml) Put(key string, value interface{}) *yaml.Node
- func (d *DynamicYaml) PutByParts(parts []string, value interface{}) *yaml.Node
- func (d *DynamicYaml) PutByPartsNode(parts []string, value *yaml.Node) (*yaml.Node, error)
- func (d *DynamicYaml) PutNode(key string, value *yaml.Node) (*yaml.Node, error)
- func (d *DynamicYaml) PutWithSeparator(key string, value interface{}, separator string) *yaml.Node
- func (d *DynamicYaml) PutWithSeparatorNode(key string, value *yaml.Node, separator string) (*yaml.Node, error)
- func (d *DynamicYaml) SetTopComment(comment string) error
- func (d *DynamicYaml) Sort()
- func (d *DynamicYaml) String() (string, error)
- type FlatMapKeyFormatter
- type NodePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDotFlatMapKeyFormatter ¶
e.g. path = "", newPart = "root". Return: "root"
path = "root", newPart = "child". Return: "root.child"
func ApplyCmdWithError ¶ added in v1.0.0
ApplyCmdWithError runs the kubectl apply command and returns an error, if any.
func GetBearerToken ¶
func GetDeployedWebURL ¶
func GetDeployedWebURL(yamlFile *DynamicYaml) (string, error)
func GetWildCardDNS ¶
func GetYamlStringValue ¶ added in v1.0.0
GetYamlStringValue will attempt to get the key from the input mapping and return it as a lowercase string If the key does not exist, nil is returned, with no error If the value exists, but is not a string, an error is returned
func IsApplicationControllerManagerRunning ¶ added in v1.0.0
func IsApplicationControllerManagerRunning(c *kubernetes.Clientset) (bool, error)
IsApplicationControllerManagerRunning checks if the application-controller-manager pod is running
func KubectlApply ¶
KubectlApply applies the yaml at the given filePath
func KubectlDelete ¶ added in v0.17.0
KubectlDelete run's kubectl delete using the input filePath
func KubectlGet ¶
func KubectlPatch ¶ added in v1.0.0
KubectlPatch patches a resource. resource example: serviceaccount/default
func ListOnepanelEnabledNamespaces ¶ added in v1.0.2
func ListOnepanelEnabledNamespaces(c *kubernetes.Clientset) (namespaces []string, err error)
func LowerCamelCaseStringFormat ¶ added in v0.12.0
LowerCamelCaseStringFormat takes a string, splits it by the separator and joins the pieces using LowerCamelCaseFlatMapKeyFormatter
func NamespacesExist ¶ added in v1.0.0
func NamespacesExist(c *kubernetes.Clientset, namespaces ...string) (bool, error)
NamespacesExist checks if the cluster has the input namespaces
func NamespacesToCheck ¶ added in v1.0.0
func NamespacesToCheck(yamlFile *DynamicYaml) []string
NamespacesToCheck returns an array of namespaces to check depending on what's present in the yamlFile
func NewKubernetesClient ¶ added in v1.0.0
func NewKubernetesClient() (*kubernetes.Clientset, error)
NewKubernetesClient creates a kubernetes client with the config returned from NewConfig
func NodeValueToActual ¶
func NodeValueToActual(node *yaml.Node) (interface{}, error)
func PrintClusterNetworkInformation ¶ added in v1.0.0
func PrintClusterNetworkInformation(c *kubernetes.Clientset, url string)
PrintClusterNetworkInformation prints the ip address of the cluster and network DNS configuration required
func RandASCIIBytes ¶ added in v0.18.0
RandASCIIBytes generates n rando ASCII bytes adapted from source: https://github.com/kpbird/golang_random_string/blob/master/main.go
func RandASCIIString ¶ added in v0.18.0
RandASCIIString returns a rnadom string up to n characters
func RefreshAuthToken ¶
func RefreshAuthToken(in *restclient.Config) error
func RefreshTokenIfExpired ¶
func RefreshTokenIfExpired(restConfig *restclient.Config, explicitPath, curentToken string) (string, error)
func ReloadKubeConfig ¶
func ReloadKubeConfig(explicitPath string) clientcmd.ClientConfig
Types ¶
type Config ¶
type Config = restclient.Config
type DynamicYaml ¶
type DynamicYaml struct {
// contains filtered or unexported fields
}
func LoadDynamicYamlFromFile ¶
func LoadDynamicYamlFromFile(filePath string) (*DynamicYaml, error)
func LoadDynamicYamlFromString ¶
func LoadDynamicYamlFromString(input string) (*DynamicYaml, error)
func (*DynamicYaml) Delete ¶
func (d *DynamicYaml) Delete(key string) error
func (*DynamicYaml) DeleteByParts ¶
func (d *DynamicYaml) DeleteByParts(parts ...string) error
func (*DynamicYaml) DeleteByString ¶
func (d *DynamicYaml) DeleteByString(key, separator string) error
func (*DynamicYaml) FindMissingKeys ¶ added in v0.17.0
func (d *DynamicYaml) FindMissingKeys(keys ...string) []string
FindMissingKeys will return an array of the keys that are not in the manifest
func (*DynamicYaml) Flatten ¶
func (d *DynamicYaml) Flatten(keyFormatter FlatMapKeyFormatter) map[string]NodePair
func (*DynamicYaml) FlattenRequiredDefault ¶
func (d *DynamicYaml) FlattenRequiredDefault()
FlattenRequiredDefault goes through the data and finds values with a default it then assigns the default value to the key in the data so when it is serialized it has that set. this also removes the subdata, so if you have s3.bucket.default, and s3.bucket.test, only s3.bucket will be present after.
func (*DynamicYaml) FlattenToKeyValue ¶
func (d *DynamicYaml) FlattenToKeyValue(keyFormatter FlatMapKeyFormatter) map[string]interface{}
func (*DynamicYaml) Get ¶
func (d *DynamicYaml) Get(key string) (keyNode, value *yaml.Node)
func (*DynamicYaml) GetByParts ¶
func (d *DynamicYaml) GetByParts(parts ...string) (key, value *yaml.Node)
func (*DynamicYaml) GetValue ¶
func (d *DynamicYaml) GetValue(key string) (value *yaml.Node)
func (*DynamicYaml) GetValueByParts ¶
func (d *DynamicYaml) GetValueByParts(parts ...string) (value *yaml.Node)
func (*DynamicYaml) GetValueWithSeparator ¶
func (d *DynamicYaml) GetValueWithSeparator(key, separator string) (value *yaml.Node)
func (*DynamicYaml) GetWithSeparator ¶
func (d *DynamicYaml) GetWithSeparator(key, separator string) (keyNode, value *yaml.Node)
func (*DynamicYaml) HasKey ¶
func (d *DynamicYaml) HasKey(key string) bool
func (*DynamicYaml) HasKeys ¶
func (d *DynamicYaml) HasKeys(keys ...string) bool
func (*DynamicYaml) Merge ¶
func (d *DynamicYaml) Merge(items ...*DynamicYaml)
Merge will merge two DynamicYaml's together. If keys already exist, the source is kept.
func (*DynamicYaml) Put ¶
func (d *DynamicYaml) Put(key string, value interface{}) *yaml.Node
func (*DynamicYaml) PutByParts ¶
func (d *DynamicYaml) PutByParts(parts []string, value interface{}) *yaml.Node
func (*DynamicYaml) PutByPartsNode ¶
func (d *DynamicYaml) PutByPartsNode(parts []string, value *yaml.Node) (*yaml.Node, error)
func (*DynamicYaml) PutNode ¶
func (d *DynamicYaml) PutNode(key string, value *yaml.Node) (*yaml.Node, error)
func (*DynamicYaml) PutWithSeparator ¶
func (d *DynamicYaml) PutWithSeparator(key string, value interface{}, separator string) *yaml.Node
func (*DynamicYaml) PutWithSeparatorNode ¶
func (d *DynamicYaml) PutWithSeparatorNode(key string, value *yaml.Node, separator string) (*yaml.Node, error)
func (*DynamicYaml) SetTopComment ¶ added in v0.15.0
func (d *DynamicYaml) SetTopComment(comment string) error
SetTopComment sets the topmost comment in the resulting yaml
func (*DynamicYaml) Sort ¶
func (d *DynamicYaml) Sort()
func (*DynamicYaml) String ¶
func (d *DynamicYaml) String() (string, error)
type FlatMapKeyFormatter ¶
Path might be an empty string, denoting the start of a path. In that case, it is expected that newPart in some formatted form will be return. e.g. path = "", newPart = "root". Return: "root"
path = "root", newPart = "child". Return: "root.child"