definition

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BuiltinPackageDomain Specify the domain of the built-in package
	BuiltinPackageDomain = "kube"
	// K8sResourcePrefix Indicates that the definition comes from kubernetes
	K8sResourcePrefix = "io_k8s_api_"
)
View Source
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"
)
View Source
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

func GetCommonLabels added in v1.0.0

func GetCommonLabels(contextLabels map[string]string) map[string]string

GetCommonLabels will convert context based labels to OAM standard labels

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

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

type VersionKind struct {
	DefinitionName string
	APIVersion     string
	Kind           string
}

VersionKind contains the resource metadata and reference name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL