cmd

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cmd provides subcommands for the main.go CLI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKubernetesClient added in v0.0.21

func CreateKubernetesClient(contextName string) (client.Client, error)

func CreateKubernetesClientOrDie added in v0.0.21

func CreateKubernetesClientOrDie(contextName string) client.Client

func CreateROrDie added in v0.0.21

func CreateROrDie(env *ENV, obj client.Object)

func GetCRUDSubcommands added in v0.0.21

func GetCRUDSubcommands() (*cobra.Command, *cobra.Command, *cobra.Command)

func GetM added in v0.0.21

func GetM(env *ENV, name string, obj client.Object) (bool, error)

func GetMOrDie added in v0.0.21

func GetMOrDie(env *ENV, name string, obj client.Object) bool

func MkApplyCmd

func MkApplyCmd() *cobra.Command

func MkBackupCmd

func MkBackupCmd() *cobra.Command

func MkNodepoolCmd added in v0.0.21

func MkNodepoolCmd() *cobra.Command

func MkRestoreCmd

func MkRestoreCmd() *cobra.Command

func UpdateROrDie added in v0.0.21

func UpdateROrDie(env *ENV, obj client.Object)

Types

type ENV added in v0.0.21

type ENV struct {
	Cli client.Client
	Ns  string
	Ctx context.Context
}

Moving code from cli/sfconfig/cmd/utils/utils.go as we need it to avoid dead code

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL