Documentation
¶
Index ¶
Constants ¶
const (
// OpenapiV3JSONSchema is the key to store OpenAPI v3 JSON schema in ConfigMap
OpenapiV3JSONSchema string = "openapi-v3-json-schema"
// UISchema is the key to store ui custom schema
UISchema string = "ui-schema"
)
const (
ReasonParsed = "Parsed"
ReasonRendered = "Rendered"
ReasonPolicyGenerated = "PolicyGenerated"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonFailedParse = "FailedParse"
ReasonFailedRender = "FailedRender"
ReasonFailedRevision = "FailedRevision"
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedHealthCheck = "FailedHealthCheck"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
ReasonFailedRollout = "FailedRollout"
)
reason for Application
const (
MessageParsed = "Parsed successfully"
MessageRendered = "Rendered successfully"
MessagePolicyGenerated = "Policy generated successfully"
MessageRevisioned = "Revisioned successfully"
MessageApplied = "Applied successfully"
MessageWorkflowFinished = "Workflow finished"
MessageHealthCheck = "Health checked healthy"
MessageDeployed = "Deployed successfully"
MessageRollout = "Rollout successfully"
MessageFailedParse = "fail to parse application, err: %v"
MessageFailedRender = "fail to render application, err: %v"
MessageFailedRevision = "fail to handle application revision, err: %v"
MessageFailedApply = "fail to apply component, err: %v"
MessageFailedHealthCheck = "fail to health check, err: %v"
MessageFailedGC = "fail to garbage collection, err: %v"
)
event message for Application
const (
// DefaultKubeVelaNS defines the default KubeVela namespace in Kubernetes
DefaultKubeVelaNS = "vela-system"
// DefaultKubeVelaReleaseName defines the default name of KubeVela Release
DefaultKubeVelaReleaseName = "kubevela"
// DefaultKubeVelaChartName defines the default chart name of KubeVela, this variable MUST align to the chart name of this repo
DefaultKubeVelaChartName = "vela-core"
// DefaultKubeVelaVersion defines the default version needed for KubeVela chart
DefaultKubeVelaVersion = ">0.0.0-0"
// DefaultEnvName defines the default environment name for Apps created by KubeVela
DefaultEnvName = "default"
// DefaultAppNamespace defines the default K8s namespace for Apps created by KubeVela
DefaultAppNamespace = "default"
// AutoDetectWorkloadDefinition defines the default workload type for ComponentDefinition which doesn't specify a workload
AutoDetectWorkloadDefinition = "autodetects.core.oam.dev"
)
const (
// AnnoDefinitionDescription is the annotation which describe what is the capability used for in a WorkloadDefinition/TraitDefinition Object
AnnoDefinitionDescription = "definition.oam.dev/description"
// AnnoDefinitionAppliedWorkloads is the annotation which describe what is the workloads used for in a TraitDefinition Object
AnnoDefinitionAppliedWorkloads = "definition.oam.dev/appliedWorkloads"
// LabelDefinition is the label for definition
LabelDefinition = "definition.oam.dev"
// LabelDefinitionName is the label for definition name
LabelDefinitionName = "definition.oam.dev/name"
// LabelDefinitionDeprecated is the label which describe whether the capability is deprecated
LabelDefinitionDeprecated = "custom.definition.oam.dev/deprecated"
// LabelDefinitionHidden is the label which describe whether the capability is hidden by UI
LabelDefinitionHidden = "custom.definition.oam.dev/ui-hidden"
)
const (
// StatusDeployed represents the App was deployed
StatusDeployed = "Deployed"
// StatusStaging represents the App was changed locally and it's spec is diff from the deployed one, or not deployed at all
StatusStaging = "Staging"
)
const (
// TagCommandType used for tag cli category
TagCommandType = "commandType"
// TypeStart defines one category
TypeStart = "Getting Started"
// TypeApp defines one category
TypeApp = "Managing Applications"
// TypeCap defines one category
TypeCap = "Managing Capabilities"
// TypeSystem defines one category
TypeSystem = "System"
// TypeDefinition defines one category
TypeDefinition = "Managing Definitions"
// TypePlugin defines one category used in Kubectl Plugin
TypePlugin = "Plugin Command"
)
const CapabilityConfigMapNamePrefix = "schema-"
CapabilityConfigMapNamePrefix is the prefix for capability ConfigMap name
const LabelArg = "label"
LabelArg is the argument `label` of a definition
Variables ¶
var DefaultFilterAnnots = []string{
oam.AnnotationAppRollout,
oam.AnnotationRollingComponent,
oam.AnnotationInplaceUpgrade,
oam.AnnotationFilterLabelKeys,
oam.AnnotationFilterAnnotationKeys,
oam.AnnotationLastAppliedConfiguration,
}
DefaultFilterAnnots are annotations that won't pass to workload or trait
Functions ¶
Types ¶
type CRDInfo ¶
type CRDInfo struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
}
CRDInfo record the CRD info of the Capability
type CapType ¶
type CapType string
CapType defines the type of capability
const (
// TypeComponentDefinition represents OAM ComponentDefinition
TypeComponentDefinition CapType = "componentDefinition"
// TypeWorkload represents OAM Workload
TypeWorkload CapType = "workload"
// TypeTrait represents OAM Trait
TypeTrait CapType = "trait"
// TypeScope represent OAM Scope
TypeScope CapType = "scope"
// TypeWorkflowStep represent OAM Workflow
TypeWorkflowStep CapType = "workflowstep"
// TypePolicy represent OAM Policy
TypePolicy CapType = "policy"
)
type Capability ¶
type Capability struct {
Name string `json:"name"`
Type CapType `json:"type"`
CueTemplate string `json:"template,omitempty"`
CueTemplateURI string `json:"templateURI,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
CrdName string `json:"crdName,omitempty"`
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Category CapabilityCategory `json:"category,omitempty"`
// trait only
AppliesTo []string `json:"appliesTo,omitempty"`
// Namespace represents it's a system-level or user-level capability.
Namespace string `json:"namespace,omitempty"`
// Plugin Source
Source *Source `json:"source,omitempty"`
Install *Installation `json:"install,omitempty"`
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
// Terraform
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
// KubeTemplate
KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"`
KubeParameter []common.KubeParameter `json:"kubeparameter,omitempty"`
}
Capability defines the content of a capability
type CapabilityCategory ¶ added in v0.3.1
type CapabilityCategory string
CapabilityCategory defines the category of a capability
const (
TerraformCategory CapabilityCategory = "terraform"
HelmCategory CapabilityCategory = "helm"
KubeCategory CapabilityCategory = "kube"
CUECategory CapabilityCategory = "cue"
)
categories of capability schematic
type Chart ¶
type Chart struct {
Repo string `json:"repo"`
URL string `json:"url"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Version string `json:"version"`
Values map[string]interface{} `json:"values"`
}
Chart defines all necessary information to install a whole chart
type Cluster ¶ added in v1.2.0
type Cluster struct {
Name string
Type string
EndPoint string
Accepted bool
}
Cluster contains base info of cluster
type ComponentManifest ¶ added in v1.1.0
type ComponentManifest struct {
Name string
Namespace string
RevisionName string
RevisionHash string
ExternalRevision string
StandardWorkload *unstructured.Unstructured
Traits []*unstructured.Unstructured
Scopes []*corev1.ObjectReference
// PackagedWorkloadResources contain all the workload related resources. It could be a Helm
// Release, Git Repo or anything that can package and run a workload.
PackagedWorkloadResources []*unstructured.Unstructured
PackagedTraitResources map[string][]*unstructured.Unstructured
}
ComponentManifest contains resources rendered from an application component.
type EnvMeta ¶
type EnvMeta struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Current string `json:"current,omitempty"`
}
EnvMeta stores the namespace for app environment
type Installation ¶
type Installation struct {
Helm Chart `json:"helm"`
}
Installation defines the installation method for this Capability, currently only helm is supported
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
Short string `json:"short,omitempty"`
Required bool `json:"required,omitempty"`
Default interface{} `json:"default,omitempty"`
Usage string `json:"usage,omitempty"`
Ignore bool `json:"ignore,omitempty"`
Type cue.Kind `json:"type,omitempty"`
Alias string `json:"alias,omitempty"`
JSONType string `json:"jsonType,omitempty"`
}
Parameter defines a parameter for cli from capability template
type RollingStatus ¶ added in v1.0.0
type RollingStatus string
RollingStatus represents the rollout phases
const (
// RollingTemplating means that the AC is rolling and need template
RollingTemplating RollingStatus = "RollingTemplating"
// RollingTemplated means that the AC is rolling and it already templated
RollingTemplated RollingStatus = "RollingTemplated"
// RollingCompleted means that the AC is the new active revision of the application
RollingCompleted RollingStatus = "RollingCompleted"
// InactiveAfterRollingCompleted means that the AC is the inactive revision after the rolling is finished
InactiveAfterRollingCompleted RollingStatus = "InactiveAfterRollingCompleted"
)
type Source ¶
type Source struct {
RepoName string `json:"repoName"`
ChartName string `json:"chartName,omitempty"`
}
Source record the source of Capability
type WorkflowContext ¶ added in v1.1.0
type WorkflowContext struct {
AppName string `json:"appName,omitempty"`
AppRevision string `json:"appRevision,omitempty"`
WorkflowIndex int `json:"workflowIndex"`
ResourceConfigMap corev1.LocalObjectReference `json:"resourceConfigMap,omitempty"`
}
WorkflowContext is the workflow context to pass into workflow objects.