Documentation ¶
Overview ¶
Package utils provides CLI utility functions and structs
Index ¶
- func CreateKubernetesClient(contextName string) (client.Client, error)
- func CreateKubernetesClientOrDie(contextName string) client.Client
- func CreateROrDie(env *ENV, obj client.Object)
- func DeleteAllOfOrDie(env *ENV, obj client.Object, opts ...client.DeleteAllOfOption)
- func DeleteOrDie(env *ENV, obj client.Object, opts ...client.DeleteOption) bool
- func EnsureNamespaceOrDie(env *ENV, name string)
- func EnsureServiceAccountOrDie(env *ENV, name string)
- func GetCRUDSubcommands() (*cobra.Command, *cobra.Command, *cobra.Command)
- func GetFileContent(filePath string) ([]byte, error)
- func GetM(env *ENV, name string, obj client.Object) (bool, error)
- func GetMOrDie(env *ENV, name string, obj client.Object) bool
- func RunCmdOrDie(cmd string, args ...string) string
- func RunCmdWithEnvOrDie(environ []string, cmd string, args ...string) string
- func UpdateROrDie(env *ENV, obj client.Object)
- func VarListToMap(varsList []string) map[string]string
- type ENV
- type SoftwareFactoryConfig
- type SoftwareFactoryConfigContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKubernetesClient ¶
func CreateROrDie ¶
func DeleteAllOfOrDie ¶
func DeleteAllOfOrDie(env *ENV, obj client.Object, opts ...client.DeleteAllOfOption)
func DeleteOrDie ¶
func EnsureNamespaceOrDie ¶ added in v0.0.24
func EnsureServiceAccountOrDie ¶ added in v0.0.24
func GetCRUDSubcommands ¶
func GetFileContent ¶
func RunCmdOrDie ¶ added in v0.0.23
func RunCmdWithEnvOrDie ¶ added in v0.0.23
func UpdateROrDie ¶
func VarListToMap ¶ added in v0.0.24
Types ¶
type SoftwareFactoryConfig ¶
type SoftwareFactoryConfig struct { Contexts map[string]SoftwareFactoryConfigContext `json:"contexts" mapstructure:"contexts"` Default string `json:"default-context" mapstructure:"default-context"` }
type SoftwareFactoryConfigContext ¶
type SoftwareFactoryConfigContext struct { ConfigRepository string `json:"config-repository-path" mapstructure:"config-repository-path"` Manifest string `json:"manifest-file" mapstructure:"manifest-file"` IsStandalone bool `json:"standalone" mapstructure:"standalone"` Namespace string `json:"namespace" mapstructure:"namespace"` KubeContext string `json:"kube-context" mapstructure:"kube-context"` FQDN string `json:"fqdn" mapstructure:"fqdn"` Dev struct { AnsibleMicroshiftRolePath string `json:"ansible-microshift-role-path" mapstructure:"ansible-microshift-role-path"` SFOperatorRepositoryPath string `json:"sf-operator-repository-path" mapstructure:"sf-operator-repository-path"` Microshift struct { Host string `json:"host" mapstructure:"host"` User string `json:"user" mapstructure:"user"` OpenshiftPullSecret string `json:"openshift-pull-secret" mapstructure:"openshift-pull-secret"` DiskFileSize string `json:"disk-file-size" mapstructure:"disk-file-size"` } `json:"microshift" mapstructure:"microshift"` Tests struct { DemoReposPath string `json:"demo-repos-path" mapstructure:"demo-repos-path"` ExtraVars map[string]string `json:"extra-vars" mapstructure:"extra-vars"` } `json:"tests" mapstructure:"tests"` } `json:"development" mapstructure:"development"` Components struct { Nodepool struct { CloudsFile string `json:"clouds-file" mapstructure:"clouds-file"` KubeFile string `json:"kube-file" mapstructure:"kube-file"` } `json:"nodepool" mapstructure:"nodepool"` } `json:"components" mapstructure:"components"` }
CLI config struct
func GetCLIContext ¶
func GetCLIContext(command *cobra.Command) (SoftwareFactoryConfigContext, error)
func GetCLIctxOrDie ¶
func GetCLIctxOrDie(kmd *cobra.Command, args []string, allowedArgs []string) SoftwareFactoryConfigContext
Click to show internal directories.
Click to hide internal directories.