Documentation ¶
Index ¶
- Constants
- Variables
- func AskToChooseOneEnvResource(app *v1beta1.Application, resourceName ...string) (*common.ClusterObjectReference, error)
- func AskToChooseOneNamespace(c client.Client, envMeta *types.EnvMeta) error
- func AskToChooseOnePods(podNames []string) (string, error)
- func AskToChooseOnePortForwardEndpoint(app *v1beta1.Application, resourceName ...string) (*common.ClusterObjectReference, error)
- func AskToChooseOneService(svcNames []string) (string, error)
- func ClusterObject2Map(refs []common.ClusterObjectReference) map[string]string
- func GenOpenAPI(inst *cue.Instance) ([]byte, error)
- func GenerateUnstructuredObj(name, ns string, gvk schema.GroupVersionKind) *unstructured.Unstructured
- func GetCUEParameterValue(cueStr string, pd *packages.PackageDiscover) (cue.Value, error)
- func GetClient() (client.Client, error)
- func HTTPGetWithOption(ctx context.Context, url string, opts *HTTPOption) ([]byte, error)
- func NewK8sClient() (client.Client, error)
- func ParseTerraformVariables(configuration string) (map[string]*tfconfig.Variable, map[string]*tfconfig.Output, error)
- func ReadYamlToObject(path string, object k8sruntime.Object) error
- func RealtimePrintCommandOutput(cmd *exec.Cmd, logFile string) error
- func RefineParameterInstance(inst *cue.Instance) (*cue.Instance, error)
- func SetGlobalClient(clt client.Client) error
- func SetSpecObjIntoUnstructuredObj(spec interface{}, u *unstructured.Unstructured) error
- type Args
- func (a *Args) GetClient() (client.Client, error)
- func (a *Args) GetConfig() (*rest.Config, error)
- func (a *Args) GetDiscoveryClient() (*discovery.DiscoveryClient, error)
- func (a *Args) GetDiscoveryMapper() (discoverymapper.DiscoveryMapper, error)
- func (a *Args) GetFakeClient(defs []oam.Object) (client.Client, error)
- func (a *Args) GetPackageDiscover() (*packages.PackageDiscover, error)
- func (a *Args) SetClient(c client.Client)
- func (a *Args) SetConfig(c *rest.Config) error
- type HTTPOption
- type ResourceLocation
Constants ¶
const ( // AddonObservabilityApplication is the application name for Addon Observability AddonObservabilityApplication = "addon-observability" // AddonObservabilityGrafanaSvc is grafana service name for Addon Observability AddonObservabilityGrafanaSvc = "grafana" )
const CreateCustomNamespace = "create new namespace"
CreateCustomNamespace display the create namespace message
Variables ¶
var ( // Scheme defines the default KubeVela schema Scheme = k8sruntime.NewScheme() )
Functions ¶
func AskToChooseOneEnvResource ¶ added in v1.1.9
func AskToChooseOneEnvResource(app *v1beta1.Application, resourceName ...string) (*common.ClusterObjectReference, error)
AskToChooseOneEnvResource will ask users to select one applied resource of the application if more than one resource is a map for component to applied resources return the selected ClusterObjectReference
func AskToChooseOneNamespace ¶ added in v1.2.0
AskToChooseOneNamespace ask for choose one namespace as env
func AskToChooseOnePods ¶ added in v1.1.9
AskToChooseOnePods will ask users to select one pods of the resource if more than one
func AskToChooseOnePortForwardEndpoint ¶ added in v1.2.0
func AskToChooseOnePortForwardEndpoint(app *v1beta1.Application, resourceName ...string) (*common.ClusterObjectReference, error)
AskToChooseOnePortForwardEndpoint will ask user to select one applied resource as port forward endpoint
func AskToChooseOneService ¶ added in v1.0.0
AskToChooseOneService will ask users to select one service of the application if more than one
func ClusterObject2Map ¶ added in v1.1.8
func ClusterObject2Map(refs []common.ClusterObjectReference) map[string]string
ClusterObject2Map convert ClusterObjectReference to a readable map
func GenOpenAPI ¶ added in v0.3.0
GenOpenAPI generates OpenAPI json schema from cue.Instance
func GenerateUnstructuredObj ¶ added in v1.1.0
func GenerateUnstructuredObj(name, ns string, gvk schema.GroupVersionKind) *unstructured.Unstructured
GenerateUnstructuredObj generate UnstructuredObj
func GetCUEParameterValue ¶ added in v0.3.0
GetCUEParameterValue converts definitions to cue format
func HTTPGetWithOption ¶ added in v1.3.1
HTTPGetWithOption use HTTP option and default client to send get request
func NewK8sClient ¶ added in v1.1.0
NewK8sClient init a local k8s client which add oamcore scheme
func ParseTerraformVariables ¶ added in v1.0.6
func ParseTerraformVariables(configuration string) (map[string]*tfconfig.Variable, map[string]*tfconfig.Output, error)
ParseTerraformVariables get variables from Terraform Configuration
func ReadYamlToObject ¶ added in v1.0.0
func ReadYamlToObject(path string, object k8sruntime.Object) error
ReadYamlToObject will read a yaml K8s object to runtime.Object
func RealtimePrintCommandOutput ¶ added in v0.3.1
RealtimePrintCommandOutput prints command output in real time If logFile is "", it will prints the stdout, or it will write to local file
func RefineParameterInstance ¶ added in v1.1.0
RefineParameterInstance refines cue instance to merely include `parameter` identifier
func SetGlobalClient ¶ added in v1.1.4
SetGlobalClient will set a client for one cli command
func SetSpecObjIntoUnstructuredObj ¶ added in v1.1.0
func SetSpecObjIntoUnstructuredObj(spec interface{}, u *unstructured.Unstructured) error
SetSpecObjIntoUnstructuredObj set UnstructuredObj spec field
Types ¶
type Args ¶ added in v1.0.0
Args is args for controller-runtime client
func InitBaseRestConfig ¶
InitBaseRestConfig will return reset config for create controller runtime client
func (*Args) GetDiscoveryClient ¶ added in v1.2.4
func (a *Args) GetDiscoveryClient() (*discovery.DiscoveryClient, error)
GetDiscoveryClient return a discovery client from cli args
func (*Args) GetDiscoveryMapper ¶ added in v1.0.0
func (a *Args) GetDiscoveryMapper() (discoverymapper.DiscoveryMapper, error)
GetDiscoveryMapper get discoveryMapper client if exist, create if not exist.
func (*Args) GetFakeClient ¶ added in v1.4.0
GetFakeClient returns a fake client with the definition objects preloaded
func (*Args) GetPackageDiscover ¶ added in v1.0.0
func (a *Args) GetPackageDiscover() (*packages.PackageDiscover, error)
GetPackageDiscover get PackageDiscover client if exist, create if not exist.
type HTTPOption ¶ added in v1.3.1
HTTPOption define the https options
type ResourceLocation ¶ added in v1.1.9
ResourceLocation indicates the resource location