github.com/oam-dev/kubevela@v1.9.11/vela-templates/definitions/internal/policy/apply-once.cue (about)

     1  "apply-once": {
     2  	annotations: {}
     3  	description: "Allow configuration drift for applied resources, delivery the resource without continuously reconciliation."
     4  	labels: {}
     5  	attributes: {}
     6  	type: "policy"
     7  }
     8  
     9  template: {
    10  	#ApplyOnceStrategy: {
    11  		// +usage=When the strategy takes effect,e.g. onUpdate、onStateKeep
    12  		affect?: string
    13  		// +usage=Specify the path of the resource that allow configuration drift
    14  		path: [...string]
    15  	}
    16  
    17  	#ApplyOncePolicyRule: {
    18  		// +usage=Specify how to select the targets of the rule
    19  		selector?: #ResourcePolicyRuleSelector
    20  		// +usage=Specify the strategy for configuring the resource level configuration drift behaviour
    21  		strategy: #ApplyOnceStrategy
    22  	}
    23  
    24  	#ResourcePolicyRuleSelector: {
    25  		// +usage=Select resources by component names
    26  		componentNames?: [...string]
    27  		// +usage=Select resources by component types
    28  		componentTypes?: [...string]
    29  		// +usage=Select resources by oamTypes (COMPONENT or TRAIT)
    30  		oamTypes?: [...string]
    31  		// +usage=Select resources by trait types
    32  		traitTypes?: [...string]
    33  		// +usage=Select resources by resource types (like Deployment)
    34  		resourceTypes?: [...string]
    35  		// +usage=Select resources by their names
    36  		resourceNames?: [...string]
    37  	}
    38  
    39  	parameter: {
    40  		// +usage=Whether to enable apply-once for the whole application
    41  		enable: *false | bool
    42  		// +usage=Specify the rules for configuring apply-once policy in resource level
    43  		rules?: [...#ApplyOncePolicyRule]
    44  	}
    45  }