Documentation ¶
Index ¶
- Constants
- Variables
- func AskToChooseOneNamespace(c client.Client, envMeta *types.EnvMeta) error
- func FillParameterDefinitionFieldIfNotExist(val cue.Value) cue.Value
- func GenOpenAPI(val cue.Value) (b []byte, err error)
- func GenOpenAPIWithCueX(val cue.Value) (b []byte, err error)
- func GenerateUnstructuredObj(name, ns string, gvk schema.GroupVersionKind) *unstructured.Unstructured
- func GetCUEParameterValue(cueStr string) (cue.Value, error)
- func HTTPGetKubernetesObjects(ctx context.Context, url string) ([]*unstructured.Unstructured, error)
- func HTTPGetResponse(ctx context.Context, url string, opts *HTTPOption) (*http.Response, 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 RefineParameterValue(val cue.Value) (cue.Value, 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) GetDynamicClient() (dynamic.Interface, error)
- func (a *Args) GetFakeClient(defs []*unstructured.Unstructured) (client.Client, error)
- func (a *Args) GetNamespaceFromConfig() string
- func (a *Args) GetRawConfig() (*api.Config, error)
- func (a *Args) SetClient(c client.Client)
- func (a *Args) SetConfig(c *rest.Config) error
- type HTTPOption
Constants ¶
const CreateCustomNamespace = "create new namespace"
CreateCustomNamespace display the create namespace message
Variables ¶
var ( // Scheme defines the default KubeVela schema Scheme = k8sruntime.NewScheme() )
Functions ¶
func AskToChooseOneNamespace ¶ added in v1.2.0
AskToChooseOneNamespace ask for choose one namespace as env
func FillParameterDefinitionFieldIfNotExist ¶ added in v1.9.0
FillParameterDefinitionFieldIfNotExist refines cue value to merely include `parameter` identifier
func GenOpenAPI ¶ added in v0.3.0
GenOpenAPI generates OpenAPI json schema from cue.Instance
func GenOpenAPIWithCueX ¶ added in v1.9.0
GenOpenAPIWithCueX 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 HTTPGetKubernetesObjects ¶ added in v1.5.0
func HTTPGetKubernetesObjects(ctx context.Context, url string) ([]*unstructured.Unstructured, error)
HTTPGetKubernetesObjects use HTTP requests to load resources from remote url
func HTTPGetResponse ¶ added in v1.5.0
HTTPGetResponse use HTTP option and default client to send request and get raw response
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 RefineParameterValue ¶ added in v1.6.0
RefineParameterValue refines cue value to merely include `parameter` identifier
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) GetDynamicClient ¶
GetDynamicClient return a dynamic client from cli args
func (*Args) GetFakeClient ¶ added in v1.4.0
func (a *Args) GetFakeClient(defs []*unstructured.Unstructured) (client.Client, error)
GetFakeClient returns a fake client with the definition objects preloaded
func (*Args) GetNamespaceFromConfig ¶ added in v1.7.0
GetNamespaceFromConfig will get namespace from kube config
func (*Args) GetRawConfig ¶ added in v1.7.0
GetRawConfig get raw kubeconfig, if not exist, will create
type HTTPOption ¶ added in v1.3.1
type HTTPOption struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` CaFile string `json:"caFile,omitempty"` CertFile string `json:"certFile,omitempty"` KeyFile string `json:"keyFile,omitempty"` InsecureSkipTLS bool `json:"insecureSkipTLS,omitempty"` }
HTTPOption define the https options