Documentation
¶
Index ¶
- Constants
- Variables
- func AskToChooseOneService(svcNames []string) (string, error)
- 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 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 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 ¶
var OAMLabel = map[string]string{"app.kubernetes.io/part-of": "kubevela"}
Functions ¶
func AskToChooseOneService ¶ added in v0.0.9
AskToChooseOneService will ask users to select one service of the application if more than one exidi
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 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