diff --git a/charts/vela-core/templates/defwithtemplate/env-binding.yaml b/charts/vela-core/templates/defwithtemplate/env-binding.yaml deleted file mode 100644 index e5134b461..000000000 --- a/charts/vela-core/templates/defwithtemplate/env-binding.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file. -# Definition source cue file: vela-templates/definitions/internal/env-binding.cue -apiVersion: core.oam.dev/v1beta1 -kind: PolicyDefinition -metadata: - annotations: - definition.oam.dev/description: Provides differentiated configuration and environment scheduling policies for application. - name: env-binding - namespace: {{ include "systemDefinitionNamespace" . }} -spec: - schematic: - cue: - template: | - output: { - apiVersion: "core.oam.dev/v1alpha1" - kind: "EnvBinding" - spec: { - engine: parameter.clusterManagementEngine - appTemplate: { - apiVersion: "core.oam.dev/v1beta1" - kind: "Application" - metadata: { - name: context.appName - namespace: context.namespace - } - spec: components: context.components - } - envs: parameter.envs - outputResourcesTo: { - name: context.name - namespace: context.namespace - } - } - } - #Env: { - name: string - patch: components: [...{ - name: string - type: string - properties: {...} - traits?: [...{ - type: string - properties: {...} - }] - }] - placement: { - clusterSelector?: { - labels?: [string]: string - name?: string - } - namespaceSelector?: { - labels?: [string]: string - name?: string - } - } - selector?: components: [...string] - } - parameter: { - clusterManagementEngine: *"cluster-gateway" | string - envs: [...#Env] - } - diff --git a/pkg/appfile/parser.go b/pkg/appfile/parser.go index 4535cf8b1..25040c94e 100644 --- a/pkg/appfile/parser.go +++ b/pkg/appfile/parser.go @@ -271,6 +271,8 @@ func (p *Parser) parsePolicies(ctx context.Context, af *Appfile) error { w, err = p.makeBuiltInPolicy(policy.Name, policy.Type, policy.Properties) case v1alpha1.ApplyOncePolicyType: w, err = p.makeBuiltInPolicy(policy.Name, policy.Type, policy.Properties) + case v1alpha1.EnvBindingPolicyType: + w, err = p.makeBuiltInPolicy(policy.Name, policy.Type, policy.Properties) case v1alpha1.TopologyPolicyType: w, err = p.makeBuiltInPolicy(policy.Name, policy.Type, policy.Properties) case v1alpha1.OverridePolicyType: diff --git a/vela-templates/definitions/internal/policy/env-binding.cue b/vela-templates/definitions/internal/policy/env-binding.cue deleted file mode 100644 index 124fa3fd3..000000000 --- a/vela-templates/definitions/internal/policy/env-binding.cue +++ /dev/null @@ -1,60 +0,0 @@ -"env-binding": { - type: "policy" - annotations: {} - labels: {} - description: "Provides differentiated configuration and environment scheduling policies for application." -} -template: { - output: { - apiVersion: "core.oam.dev/v1alpha1" - kind: "EnvBinding" - spec: { - engine: parameter.clusterManagementEngine - appTemplate: { - apiVersion: "core.oam.dev/v1beta1" - kind: "Application" - metadata: { - name: context.appName - namespace: context.namespace - } - spec: { - components: context.components - } - } - envs: parameter.envs - outputResourcesTo: { - name: context.name - namespace: context.namespace - } - } - } - #Env: { - name: string - patch: components: [...{ - name: string - type: string - properties: {...} - traits?: [...{ - type: string - properties: {...} - }] - }] - placement: { - clusterSelector?: { - labels?: [string]: string - name?: string - } - namespaceSelector?: { - labels?: [string]: string - name?: string - } - } - selector?: { - components: [...string] - } - } - parameter: { - clusterManagementEngine: *"cluster-gateway" | string - envs: [...#Env] - } -}