Documentation
¶
Index ¶
- Constants
- func CheckErr(err error)
- func DoesCRDExist(cxt context.Context, c client.Client, crdName string) (bool, error)
- func DoesNamespaceExist(c client.Client, namespace string) (bool, error)
- func GetAPIVersionKindFromTrait(td corev1alpha2.TraitDefinition) (string, string)
- func GetAPIVersionKindFromWorkload(td corev1alpha2.WorkloadDefinition) (string, string)
- func GetComponent(ctx context.Context, c client.Client, componentName string, namespace string) (corev1alpha2.Component, error)
- func GetKubeClient() error
- func GetKubeConfig() string
- func GetTraitAPIVersionKind(ctx context.Context, c client.Client, namespace string, name string) (string, string, error)
- func GetTraitDefinitionByAlias(ctx context.Context, c client.Client, traitAlias string) (corev1alpha2.TraitDefinition, error)
- func GetTraitDefinitionByName(ctx context.Context, c client.Client, namespace string, traitName string) (corev1alpha2.TraitDefinition, error)
- func GetWorkloadDefinitionByAlias(ctx context.Context, c client.Client, traitAlias string) (corev1alpha2.WorkloadDefinition, error)
- func GetWorkloadDefinitionByName(ctx context.Context, c client.Client, namespace string, name string) (corev1alpha2.WorkloadDefinition, error)
- func GetWorkloadNameAliasKind(ctx context.Context, c client.Client, namespace string, workloadName string) (string, string, string)
- func HomeDir() string
- func ListTraitDefinitionsByApplicationConfiguration(app corev1alpha2.ApplicationConfiguration) []corev1alpha2.TraitDefinition
- func NewNamespace(c client.Client, namespace string) error
- func NewRestConfigGetter(namespace string) genericclioptions.RESTClientGetter
- func Print(msg string)
- func PrintErrorMessage(errorMessage string, exitCode int)
- func PrintFlags(cmd *cobra.Command, subcmds []*cobra.Command)
- type IOStreams
Constants ¶
const (
DefaultErrorExitCode = 1
)
Variables ¶
This section is empty.
Functions ¶
func DoesCRDExist ¶ added in v0.0.8
DoesCoreCRDExist check CRD exist
func DoesNamespaceExist ¶ added in v0.0.8
DoesNamespaceExist check namespace exist
func GetAPIVersionKindFromTrait ¶
func GetAPIVersionKindFromTrait(td corev1alpha2.TraitDefinition) (string, string)
func GetAPIVersionKindFromWorkload ¶
func GetAPIVersionKindFromWorkload(td corev1alpha2.WorkloadDefinition) (string, string)
func GetComponent ¶
func GetKubeClient ¶
func GetKubeClient() error
GetKubeClient creates a Kubernetes config and client for a given kubeconfig context.
func GetKubeConfig ¶
func GetKubeConfig() string
func GetTraitAPIVersionKind ¶
func GetTraitAPIVersionKind(ctx context.Context, c client.Client, namespace string, name string) (string, string, error)
GetTraitNameAndAlias return the name and alias of a TraitDefinition by a string which might be the trait name, the trait alias, or invalid name
func GetTraitDefinitionByAlias ¶
func GetTraitDefinitionByAlias(ctx context.Context, c client.Client, traitAlias string) (corev1alpha2.TraitDefinition, error)
func GetTraitDefinitionByName ¶
func GetTraitDefinitionByName(ctx context.Context, c client.Client, namespace string, traitName string) (corev1alpha2.TraitDefinition, error)
func GetWorkloadDefinitionByAlias ¶
func GetWorkloadDefinitionByAlias(ctx context.Context, c client.Client, traitAlias string) (corev1alpha2.WorkloadDefinition, error)
func GetWorkloadDefinitionByName ¶
func GetWorkloadDefinitionByName(ctx context.Context, c client.Client, namespace string, name string) (corev1alpha2.WorkloadDefinition, error)
func ListTraitDefinitionsByApplicationConfiguration ¶
func ListTraitDefinitionsByApplicationConfiguration(app corev1alpha2.ApplicationConfiguration) []corev1alpha2.TraitDefinition
func NewRestConfigGetter ¶ added in v0.0.8
func NewRestConfigGetter(namespace string) genericclioptions.RESTClientGetter
The helm client never thought it could be used inside a cluster so it took a dependency on the kube cli, we have to create a cli client getter from the rest.Config
func PrintErrorMessage ¶
Types ¶
type IOStreams ¶
type IOStreams struct { // In think, os.Stdin In io.Reader // Out think, os.Stdout Out io.Writer // ErrOut think, os.Stderr ErrOut io.Writer }
IOStreams provides the standard names for iostreams. This is useful for embedding and for unit testing. Inconsistent and different names make it hard to read and review code
func NewTestIOStreams ¶
NewTestIOStreams returns a valid IOStreams and in, out, errout buffers for unit tests