Documentation ¶
Index ¶
Constants ¶
const ( // BuiltinPackageDomain Specify the domain of the built-in package BuiltinPackageDomain = "kube" // K8sResourcePrefix Indicates that the definition comes from kubernetes K8sResourcePrefix = "io_k8s_api_" )
const ( // OutputFieldName is the name of the struct contains the CR data OutputFieldName = process.OutputFieldName // OutputsFieldName is the name of the struct contains the map[string]CR data OutputsFieldName = process.OutputsFieldName // PatchFieldName is the name of the struct contains the patch of CR data PatchFieldName = "patch" // CustomMessage defines the custom message in definition template CustomMessage = "message" // HealthCheckPolicy defines the health check policy in definition template HealthCheckPolicy = "isHealth" )
const ( // AuxiliaryWorkload defines the extra workload obj from a workloadDefinition, // e.g. a workload composed by deployment and service, the service will be marked as AuxiliaryWorkload AuxiliaryWorkload = "AuxiliaryWorkload" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbstractEngine ¶ added in v0.3.3
type AbstractEngine interface { Complete(ctx process.Context, abstractTemplate string, params interface{}) error HealthCheck(ctx process.Context, cli client.Client, ns string, healthPolicyTemplate string) (bool, error) Status(ctx process.Context, cli client.Client, ns string, customStatusTemplate string) (string, error) }
AbstractEngine defines Definition's Render interface
func NewTraitAbstractEngine ¶ added in v0.3.3
func NewTraitAbstractEngine(name string, pd *PackageDiscover) AbstractEngine
NewTraitAbstractEngine create Trait Definition AbstractEngine
func NewWorkloadAbstractEngine ¶ added in v0.3.3
func NewWorkloadAbstractEngine(name string, pd *PackageDiscover) AbstractEngine
NewWorkloadAbstractEngine create Workload Definition AbstractEngine
type PackageDiscover ¶ added in v1.0.0
type PackageDiscover struct {
// contains filtered or unexported fields
}
PackageDiscover defines the inner CUE packages loaded from K8s cluster
func NewPackageDiscover ¶ added in v1.0.0
func NewPackageDiscover(config *rest.Config) (*PackageDiscover, error)
NewPackageDiscover will create a PackageDiscover client with the K8s config file.
func (*PackageDiscover) Exist ¶ added in v1.0.0
func (pd *PackageDiscover) Exist(gvk metav1.GroupVersionKind) bool
Exist checks if the GVK exists in the built-in packages
func (*PackageDiscover) ImportBuiltinPackagesFor ¶ added in v1.0.0
func (pd *PackageDiscover) ImportBuiltinPackagesFor(bi *build.Instance)
ImportBuiltinPackagesFor will add KubeVela built-in packages into your CUE instance
func (*PackageDiscover) ListPackageKinds ¶ added in v1.0.0
func (pd *PackageDiscover) ListPackageKinds() map[string][]VersionKind
ListPackageKinds list packages and their kinds
func (*PackageDiscover) RefreshKubePackagesFromCluster ¶ added in v1.0.0
func (pd *PackageDiscover) RefreshKubePackagesFromCluster() error
RefreshKubePackagesFromCluster will use K8s client to load/refresh all K8s open API as a reference kube package using in template
type VersionKind ¶ added in v1.0.0
VersionKind contains the resource metadata and reference name