Documentation
¶
Index ¶
- Constants
- func DetermineClusterClients(restConfig *rest.Config, kubeClient *kubernetes.Clientset) (kube, openshift bool)
- func Execute(version string)
- 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 PrintResource(crd interface{}, format string, printKubeComponents bool) 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
- type CRSpecBuilderFromCobraFlagsInterface
- type PrintFormat
Constants ¶
const DefaultMetricsImage string = "docker.io/prom/prometheus:v2.1.0"
DefaultMetricsImage is the Metrics image deployed with Synopsys Operator by default
const DefaultOperatorNamespace string = "synopsys-operator"
DefaultOperatorNamespace is the default namespace of Synopsys Operator
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 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 PrintResource ¶
PrintResource prints a Resource as yaml or json. printKubeComponents allows printing the kuberentes resources instead
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 AddCRSpecFlagsToCommand(*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