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

     1  "resource-update": {
     2  	annotations: {}
     3  	description: "Configure the update strategy for selected resources."
     4  	labels: {}
     5  	attributes: {}
     6  	type: "policy"
     7  }
     8  
     9  template: {
    10  	#PolicyRule: {
    11  		// +usage=Specify how to select the targets of the rule
    12  		selector: #RuleSelector
    13  		// +usage=The update strategy for the target resources
    14  		strategy: #Strategy
    15  	}
    16  
    17  	#Strategy: {
    18  		// +usage=Specify the op for updating target resources
    19  		op: *"patch" | "replace"
    20  		// +usage=Specify which fields would trigger recreation when updated
    21  		recreateFields?: [...string]
    22  	}
    23  
    24  	#RuleSelector: {
    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=Specify the list of rules to control resource update strategy at resource level.
    41  		rules?: [...#PolicyRule]
    42  	}
    43  }