synopsysctl

package
v0.0.0-...-5d42de7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMetricsImage string = "docker.io/prom/prometheus:v2.1.0"

DefaultMetricsImage is the Metrics image deployed with Synopsys Operator by default

View Source
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

func KubectlApplyRuntimeObjects(objects map[string]runtime.Object) error

KubectlApplyRuntimeObjects creates runtime objects by converting them to bytes and passing them through the kubectl command

func KubectlDeleteRuntimeObjects

func KubectlDeleteRuntimeObjects(objects map[string]runtime.Object) error

KubectlDeleteRuntimeObjects deletes runtime objects by converting them to bytes and passing them through the kubectl command

func PrintComponent

func PrintComponent(v interface{}, format string) (string, error)

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

func PrintComponents(objs []interface{}, format string) error

PrintComponents outputs components for a CRD in the correct format for 'kubectl create -f <file>'

func PrintResource

func PrintResource(crd interface{}, format string, printKubeComponents bool) error

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

Jump to

Keyboard shortcuts

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