Documentation ¶
Index ¶
- func DetermineClusterClients(restConfig *rest.Config, kubeClient *kubernetes.Clientset) (kube, openshift bool)
- func Execute(version string)
- func GetKubeClientFromOutsideCluster(kubeconfigpath string, insecureSkipTLSVerify bool) (*rest.Config, error)
- func KubectlApplyRuntimeObjects(objects map[string]runtime.Object) error
- func KubectlDeleteRuntimeObjects(objects map[string]runtime.Object) error
- func PrintComponent(v interface{}, format string) (string, error)
- func PrintComponentListKube(cList *api.ComponentList, format string) error
- func PrintComponents(objs []interface{}, format string) error
- func RunKubeCmd(restconfig *rest.Config, kubeClient *kubernetes.Clientset, args ...string) (string, error)
- func RunKubeCmdWithStdin(restconfig *rest.Config, kubeClient *kubernetes.Clientset, stdin string, ...) (string, error)
- func RunKubeEditorCmd(restConfig *rest.Config, kubeClient *kubernetes.Clientset, args ...string) error
- func SetHelmChartLocation(flags *pflag.FlagSet, chartName, appVersion string, chartVariable *string) error
- type CRSpecBuilderFromCobraFlagsInterface
- type PrintFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetermineClusterClients ¶
func DetermineClusterClients(restConfig *rest.Config, kubeClient *kubernetes.Clientset) (kube, openshift bool)
DetermineClusterClients returns bool values for which client to use. They will never both be true
func Execute ¶
func Execute(version string)
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GetKubeClientFromOutsideCluster ¶
func GetKubeClientFromOutsideCluster(kubeconfigpath string, insecureSkipTLSVerify bool) (*rest.Config, error)
GetKubeClientFromOutsideCluster returns the rest config of outside cluster
func KubectlApplyRuntimeObjects ¶
KubectlApplyRuntimeObjects creates runtime objects by converting them to bytes and passing them through the kubectl command
func KubectlDeleteRuntimeObjects ¶
KubectlDeleteRuntimeObjects deletes runtime objects by converting them to bytes and passing them through the kubectl command
func PrintComponent ¶
PrintComponent will print the interface in either json or yaml format
func PrintComponentListKube ¶
func PrintComponentListKube(cList *api.ComponentList, format string) error
PrintComponentListKube does
func PrintComponents ¶
PrintComponents outputs components for a CRD in the correct format for 'kubectl create -f <file>'
func RunKubeCmd ¶
func RunKubeCmd(restconfig *rest.Config, kubeClient *kubernetes.Clientset, args ...string) (string, error)
RunKubeCmd is a simple wrapper to oc/kubectl exec that captures output. TODO consider replacing w/ go api but not crucial for now.
func RunKubeCmdWithStdin ¶
func RunKubeCmdWithStdin(restconfig *rest.Config, kubeClient *kubernetes.Clientset, stdin string, args ...string) (string, error)
RunKubeCmdWithStdin is a simple wrapper to kubectl exec command with standard input
func RunKubeEditorCmd ¶
func RunKubeEditorCmd(restConfig *rest.Config, kubeClient *kubernetes.Clientset, args ...string) error
RunKubeEditorCmd is a wrapper for oc/kubectl but redirects input/output to the user - ex: let user control text editor
Types ¶
type CRSpecBuilderFromCobraFlagsInterface ¶
type CRSpecBuilderFromCobraFlagsInterface interface { GetCRSpec() interface{} // returns the spec for the resource SetCRSpec(interface{}) error // sets the spec SetPredefinedCRSpec(string) error // sets the spec to a predefined spec AddCobraFlagsToCommand(*cobra.Command, bool) // Adds flags for the resource's spec to a Cobra command CheckValuesFromFlags(*pflag.FlagSet) error // returns an error if a value for the spec is invalid GenerateCRSpecFromFlags(*pflag.FlagSet) (interface{}, error) // calls SetSpecFieldByFlag on each flag in flagset SetCRSpecFieldByFlag(*pflag.Flag) // updates the resource's spec with the value from a flag }
CRSpecBuilderFromCobraFlagsInterface requires Cobra commands, Cobra flags and other values to create a Spec for a Custom Resource.
type PrintFormat ¶
type PrintFormat string
PrintFormat represents the format to print the struct
const ( JSON PrintFormat = "JSON" YAML PrintFormat = "YAML" )
Constants for the PrintFormats