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) bool
- 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 UpdateROrDie(env *ENV, obj client.Object)
- 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 GetCRUDSubcommands ¶
func GetFileContent ¶
func UpdateROrDie ¶
Types ¶
type SoftwareFactoryConfig ¶
type SoftwareFactoryConfig struct {
Contexts map[string]SoftwareFactoryConfigContext `mapstructure:"contexts"`
Default string `mapstructure:"default-context"`
}
type SoftwareFactoryConfigContext ¶
type SoftwareFactoryConfigContext struct {
ConfigRepository string `mapstructure:"config-repository-path"`
Manifest string `mapstructure:"manifest-file"`
IsStandalone bool `mapstructure:"standalone"`
Namespace string `mapstructure:"namespace"`
KubeContext string `mapstructure:"kube-context"`
FQDN string `mapstructure:"fqdn"`
Dev struct {
AnsibleMicroshiftRolePath string `mapstructure:"ansible-microshift-role-path"`
Microshift struct {
Host string `mapstructure:"host"`
User string `mapstructure:"user"`
InventoryFile string `mapstructure:"inventory-file"`
} `mapstructure:"microshift"`
Tests struct {
ExtraVars map[string]string `mapstructure:"extra-vars"`
} `mapstructure:"tests"`
} `mapstructure:"development"`
Components struct {
Nodepool struct {
CloudsFile string `mapstructure:"clouds-file"`
KubeFile string `mapstructure:"kube-file"`
} `mapstructure:"nodepool"`
} `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.