github.com/oam-dev/kubevela@v1.9.11/pkg/oam/labels.go (about) 1 /* 2 Copyright 2019 The Crossplane Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package oam 18 19 // Label key strings. 20 // AppConfig controller will add these labels into workloads. 21 const ( 22 // LabelAppName records the name of AppConfig 23 LabelAppName = "app.oam.dev/name" 24 // LabelAppRevision records the name of Application, it's equal to name of AppConfig created by Application 25 LabelAppRevision = "app.oam.dev/appRevision" 26 // LabelAppComponent records the name of Component 27 LabelAppComponent = "app.oam.dev/component" 28 // LabelReplicaKey records the replica key of Component 29 LabelReplicaKey = "app.oam.dev/replicaKey" 30 // LabelAppComponentRevision records the revision name of Component 31 LabelAppComponentRevision = "app.oam.dev/revision" 32 // LabelOAMResourceType whether a CR is workload or trait 33 LabelOAMResourceType = "app.oam.dev/resourceType" 34 // LabelAppRevisionHash records the Hash value of the application revision 35 LabelAppRevisionHash = "app.oam.dev/app-revision-hash" 36 // LabelAppNamespace records the namespace of Application 37 LabelAppNamespace = "app.oam.dev/namespace" 38 // LabelAppCluster records the cluster of Application 39 LabelAppCluster = "app.oam.dev/cluster" 40 // LabelAppUID records the uid of Application 41 LabelAppUID = "app.oam.dev/uid" 42 43 // WorkloadTypeLabel indicates the type of the workloadDefinition 44 WorkloadTypeLabel = "workload.oam.dev/type" 45 // TraitTypeLabel indicates the type of the traitDefinition 46 TraitTypeLabel = "trait.oam.dev/type" 47 // TraitResource indicates which resource it is when a trait is composed by multiple resources in KubeVela 48 TraitResource = "trait.oam.dev/resource" 49 50 // LabelComponentDefinitionName records the name of ComponentDefinition 51 LabelComponentDefinitionName = "componentdefinition.oam.dev/name" 52 // LabelTraitDefinitionName records the name of TraitDefinition 53 LabelTraitDefinitionName = "trait.oam.dev/name" 54 // LabelManageWorkloadTrait indicates if the trait will manage the lifecycle of the workload 55 LabelManageWorkloadTrait = "trait.oam.dev/manage-workload" 56 // LabelPolicyDefinitionName records the name of PolicyDefinition 57 LabelPolicyDefinitionName = "policydefinition.oam.dev/name" 58 // LabelWorkflowStepDefinitionName records the name of WorkflowStepDefinition 59 LabelWorkflowStepDefinitionName = "workflowstepdefinition.oam.dev/name" 60 61 // LabelControllerRevisionComponent indicate which component the revision belong to 62 LabelControllerRevisionComponent = "controller.oam.dev/component" 63 64 // LabelAddonName indicates the name of the corresponding Addon 65 LabelAddonName = "addons.oam.dev/name" 66 67 // LabelAddonAuxiliaryName indicates the name of the auxiliary resource in addon app template 68 LabelAddonAuxiliaryName = "addons.oam.dev/auxiliary-name" 69 70 // LabelAddonVersion indicates the version of the corresponding installed Addon 71 LabelAddonVersion = "addons.oam.dev/version" 72 73 // LabelAddonRegistry indicates the name of addon-registry 74 LabelAddonRegistry = "addons.oam.dev/registry" 75 76 // LabelNamespaceOfEnvName records the env name of namespace 77 LabelNamespaceOfEnvName = "namespace.oam.dev/env" 78 79 // LabelNamespaceOfTargetName records the target name of namespace 80 LabelNamespaceOfTargetName = "namespace.oam.dev/target" 81 82 // LabelControlPlaneNamespaceUsage mark the usage of the namespace in control plane cluster. 83 LabelControlPlaneNamespaceUsage = "usage.oam.dev/control-plane" 84 85 // LabelRuntimeNamespaceUsage mark the usage of the namespace in runtime cluster. 86 // A control plane cluster can also be used as runtime cluster 87 LabelRuntimeNamespaceUsage = "usage.oam.dev/runtime" 88 89 // LabelConfigType means the config type 90 LabelConfigType = "config.oam.dev/type" 91 92 // LabelProject recorde the project the resource belong to 93 LabelProject = "core.oam.dev/project" 94 95 // LabelResourceRules defines the configmap is representing the resource topology rules 96 LabelResourceRules = "rules.oam.dev/resources" 97 98 // LabelResourceRuleFormat defines the resource format of the resource topology rules 99 LabelResourceRuleFormat = "rules.oam.dev/resource-format" 100 101 // LabelControllerName indicates the controller name 102 LabelControllerName = "controller.oam.dev/name" 103 104 // LabelPreCheck indicates if the target resource is for pre-check test 105 LabelPreCheck = "core.oam.dev/pre-check" 106 ) 107 108 const ( 109 // VelaNamespaceUsageEnv mark the usage of the namespace is used by env. 110 VelaNamespaceUsageEnv = "env" 111 // VelaNamespaceUsageTarget mark the usage of the namespace is used as delivery target. 112 VelaNamespaceUsageTarget = "target" 113 ) 114 115 const ( 116 // ResourceTypeTrait mark this K8s Custom Resource is an OAM trait 117 ResourceTypeTrait = "TRAIT" 118 // ResourceTypeWorkload mark this K8s Custom Resource is an OAM workload 119 ResourceTypeWorkload = "WORKLOAD" 120 ) 121 122 const ( 123 // AnnotationLastAppliedConfig records the previous configuration of a 124 // resource for use in a three-way diff during a patching apply 125 AnnotationLastAppliedConfig = "app.oam.dev/last-applied-configuration" 126 127 // AnnotationLastAppliedTime indicates the last applied time 128 AnnotationLastAppliedTime = "app.oam.dev/last-applied-time" 129 130 // AnnotationInplaceUpgrade indicates the workload should upgrade with the the same name 131 // the name of the workload instance should not changing along with the revision 132 AnnotationInplaceUpgrade = "app.oam.dev/inplace-upgrade" 133 134 // AnnotationAppRevision indicates that the object is an application revision 135 // its controller should not try to reconcile it 136 AnnotationAppRevision = "app.oam.dev/app-revision" 137 138 // AnnotationKubeVelaVersion is used to record current KubeVela version 139 AnnotationKubeVelaVersion = "oam.dev/kubevela-version" 140 141 // AnnotationFilterAnnotationKeys is used to filter annotations passed to workload and trait, split by comma 142 AnnotationFilterAnnotationKeys = "filter.oam.dev/annotation-keys" 143 144 // AnnotationFilterLabelKeys is used to filter labels passed to workload and trait, split by comma 145 AnnotationFilterLabelKeys = "filter.oam.dev/label-keys" 146 147 // AnnotationDefinitionRevisionName is used to specify the name of DefinitionRevision in component/trait definition 148 AnnotationDefinitionRevisionName = "definitionrevision.oam.dev/name" 149 150 // AnnotationLastAppliedConfiguration is kubectl annotations for 3-way merge 151 AnnotationLastAppliedConfiguration = "kubectl.kubernetes.io/last-applied-configuration" 152 153 // AnnotationDeployVersion know the version number of the deployment. 154 AnnotationDeployVersion = "app.oam.dev/deployVersion" 155 156 // AnnotationPublishVersion is annotation that record the application workflow version. 157 AnnotationPublishVersion = "app.oam.dev/publishVersion" 158 159 // AnnotationAutoUpdate is annotation that let application auto update when it finds definition changes 160 AnnotationAutoUpdate = "app.oam.dev/autoUpdate" 161 162 // AnnotationWorkflowName specifies the workflow name for execution. 163 AnnotationWorkflowName = "app.oam.dev/workflowName" 164 165 // AnnotationAppName specifies the name for application in db. 166 // Note: the annotation is only created by velaUX, please don't use it in other Source of Truth. 167 AnnotationAppName = "app.oam.dev/appName" 168 169 // AnnotationAppAlias specifies the alias for application in db. 170 AnnotationAppAlias = "app.oam.dev/appAlias" 171 172 // AnnotationControllerRequirement indicates the controller version that can process the application/definition. 173 AnnotationControllerRequirement = "app.oam.dev/controller-version-require" 174 175 // AnnotationApplicationServiceAccountName indicates the name of the ServiceAccount to use to apply Components and run Workflow. 176 // ServiceAccount will be used in the local cluster only. 177 AnnotationApplicationServiceAccountName = "app.oam.dev/service-account-name" 178 179 // AnnotationApplicationUsername indicates the username of the Application to use to apply resources 180 AnnotationApplicationUsername = "app.oam.dev/username" 181 182 // AnnotationApplicationGroup indicates the group of the Application to use to apply resources 183 AnnotationApplicationGroup = "app.oam.dev/group" 184 185 // AnnotationAppSharedBy records who share the application 186 AnnotationAppSharedBy = "app.oam.dev/shared-by" 187 188 // AnnotationResourceURL records the source url of the Kubernetes object 189 AnnotationResourceURL = "app.oam.dev/resource-url" 190 191 // AnnotationIgnoreWithoutCompKey indicates the bond component. 192 // Deprecated: please use AnnotationAddonDefinitionBindCompKey. 193 AnnotationIgnoreWithoutCompKey = "addon.oam.dev/ignore-without-component" 194 195 // AnnotationAddonDefinitionBondCompKey indicates the definition in addon bond component. 196 AnnotationAddonDefinitionBondCompKey = "addon.oam.dev/bind-component" 197 198 // AnnotationSkipResume annotation indicates that the resource does not need to be resumed. 199 AnnotationSkipResume = "controller.core.oam.dev/skip-resume" 200 ) 201 202 const ( 203 // ResourceTopologyFormatYAML mark the format of resource topology is yaml, by default, it's yaml. 204 ResourceTopologyFormatYAML = "yaml" 205 // ResourceTopologyFormatJSON mark the format of resource topology is json. 206 ResourceTopologyFormatJSON = "json" 207 ) 208 209 const ( 210 // FinalizerResourceTracker is the application finalizer for gc 211 FinalizerResourceTracker = "app.oam.dev/resource-tracker-finalizer" 212 // FinalizerOrphanResource indicates that the gc process should orphan managed 213 // resources instead of deleting them 214 FinalizerOrphanResource = "app.oam.dev/orphan-resource" 215 )