diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index c26fc276c..e2334ee9a 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -20639,7 +20639,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to interpret the dependencies of a specific resource. The script should implement a function as follows:\n luaScript: \u003e\n function GetDependencies(desiredObj)\n dependencies = {}\n if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= \"default\" then\n dependency = {}\n dependency.apiVersion = \"v1\"\n dependency.kind = \"ServiceAccount\"\n dependency.name = desiredObj.spec.serviceAccountName\n dependency.namespace = desiredObj.namespace\n dependencies[1] = {}\n dependencies[1] = dependency\n end\n return dependencies\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe returned value should be expressed by a slice of DependentObjectReference.", + "description": "LuaScript holds the Lua script that is used to interpret the dependencies of a specific resource. The script should implement a function as follows:\n\n```\n luaScript: \u003e\n function GetDependencies(desiredObj)\n dependencies = {}\n if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= \"default\" then\n dependency = {}\n dependency.apiVersion = \"v1\"\n dependency.kind = \"ServiceAccount\"\n dependency.name = desiredObj.spec.serviceAccountName\n dependency.namespace = desiredObj.namespace\n dependencies[1] = {}\n dependencies[1] = dependency\n end\n return dependencies\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe returned value should be expressed by a slice of DependentObjectReference.", "type": "string", "default": "" } @@ -20653,7 +20653,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to assess the health state of a specific resource. The script should implement a function as follows:\n luaScript: \u003e\n function InterpretHealth(observedObj)\n if observedObj.status.readyReplicas == observedObj.spec.replicas then\n return true\n end\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned boolean value indicates the health status.", + "description": "LuaScript holds the Lua script that is used to assess the health state of a specific resource. The script should implement a function as follows:\n\n```\n luaScript: \u003e\n function InterpretHealth(observedObj)\n if observedObj.status.readyReplicas == observedObj.spec.replicas then\n return true\n end\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned boolean value indicates the health status.", "type": "string", "default": "" } @@ -20667,7 +20667,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to retain runtime values to the desired specification.\n\nThe script should implement a function as follows:\n luaScript: \u003e\n function Retain(desiredObj, observedObj)\n desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned object should be a retained configuration which will be applied to member cluster eventually.", + "description": "LuaScript holds the Lua script that is used to retain runtime values to the desired specification.\n\nThe script should implement a function as follows:\n\n```\n luaScript: \u003e\n function Retain(desiredObj, observedObj)\n desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned object should be a retained configuration which will be applied to member cluster eventually.", "type": "string", "default": "" } @@ -20681,7 +20681,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to discover the resource's replica as well as resource requirements\n\nThe script should implement a function as follows:\n luaScript: \u003e\n function GetReplicas(desiredObj)\n replica = desiredObj.spec.replicas\n requirement = {}\n requirement.nodeClaim = {}\n requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector\n requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations\n requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits\n return replica, requirement\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe function expects two return values:\n - replica: the declared replica number\n - requirement: the resource required by each replica expressed with a\n ResourceBindingSpec.ReplicaRequirements.\nThe returned values will be set into a ResourceBinding or ClusterResourceBinding.", + "description": "LuaScript holds the Lua script that is used to discover the resource's replica as well as resource requirements\n\nThe script should implement a function as follows:\n\n```\n luaScript: \u003e\n function GetReplicas(desiredObj)\n replica = desiredObj.spec.replicas\n requirement = {}\n requirement.nodeClaim = {}\n requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector\n requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations\n requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits\n return replica, requirement\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe function expects two return values:\n - replica: the declared replica number\n - requirement: the resource required by each replica expressed with a\n ResourceBindingSpec.ReplicaRequirements.\nThe returned values will be set into a ResourceBinding or ClusterResourceBinding.", "type": "string", "default": "" } @@ -20695,7 +20695,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to revise replicas in the desired specification. The script should implement a function as follows:\n luaScript: \u003e\n function ReviseReplica(desiredObj, desiredReplica)\n desiredObj.spec.replicas = desiredReplica\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - desiredReplica: the replica number should be applied with.\n\nThe returned object should be a revised configuration which will be applied to member cluster eventually.", + "description": "LuaScript holds the Lua script that is used to revise replicas in the desired specification. The script should implement a function as follows:\n\n```\n luaScript: \u003e\n function ReviseReplica(desiredObj, desiredReplica)\n desiredObj.spec.replicas = desiredReplica\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - desiredReplica: the replica number should be applied with.\n\nThe returned object should be a revised configuration which will be applied to member cluster eventually.", "type": "string", "default": "" } @@ -20955,7 +20955,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to aggregate decentralized statuses to the desired specification. The script should implement a function as follows:\n luaScript: \u003e\n function AggregateStatus(desiredObj, statusItems)\n for i = 1, #statusItems do\n desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas\n end\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents a resource template.\n - statusItems: the slice of status expressed with AggregatedStatusItem.\n\nThe returned object should be a whole object with status aggregated.", + "description": "LuaScript holds the Lua script that is used to aggregate decentralized statuses to the desired specification. The script should implement a function as follows:\n\n```\n luaScript: \u003e\n function AggregateStatus(desiredObj, statusItems)\n for i = 1, #statusItems do\n desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas\n end\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents a resource template.\n - statusItems: the slice of status expressed with AggregatedStatusItem.\n\nThe returned object should be a whole object with status aggregated.", "type": "string", "default": "" } @@ -20969,7 +20969,7 @@ ], "properties": { "luaScript": { - "description": "LuaScript holds the Lua script that is used to get the status from the observed specification. The script should implement a function as follows:\n luaScript: \u003e\n function ReflectStatus(observedObj)\n status = {}\n status.readyReplicas = observedObj.status.observedObj\n return status\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned status could be the whole status or part of it and will be set into both Work and ResourceBinding(ClusterResourceBinding).", + "description": "LuaScript holds the Lua script that is used to get the status from the observed specification. The script should implement a function as follows:\n\n```\n luaScript: \u003e\n function ReflectStatus(observedObj)\n status = {}\n status.readyReplicas = observedObj.status.observedObj\n return status\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned status could be the whole status or part of it and will be set into both Work and ResourceBinding(ClusterResourceBinding).", "type": "string", "default": "" } diff --git a/charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpretercustomizations.yaml b/charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpretercustomizations.yaml index c46fd1fab..120ceda5a 100644 --- a/charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpretercustomizations.yaml +++ b/charts/karmada/_crds/bases/config/config.karmada.io_resourceinterpretercustomizations.yaml @@ -50,14 +50,14 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to interpret the dependencies of a specific resource. The - script should implement a function as follows: luaScript: + script should implement a function as follows: \n ``` luaScript: > function GetDependencies(desiredObj) dependencies = {} if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= \"default\" then dependency = {} dependency.apiVersion = \"v1\" dependency.kind = \"ServiceAccount\" dependency.name = desiredObj.spec.serviceAccountName dependency.namespace = desiredObj.namespace dependencies[1] = {} dependencies[1] - = dependency end return dependencies end \n The content + = dependency end return dependencies end ``` \n The content of the LuaScript needs to be a whole function including both declaration and implementation. \n The parameters will be supplied by the system: - desiredObj: the object represents @@ -75,10 +75,10 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to assess the health state of a specific resource. The script - should implement a function as follows: luaScript: > function - InterpretHealth(observedObj) if observedObj.status.readyReplicas - == observedObj.spec.replicas then return true end end \n - The content of the LuaScript needs to be a whole function + should implement a function as follows: \n ``` luaScript: + > function InterpretHealth(observedObj) if observedObj.status.readyReplicas + == observedObj.spec.replicas then return true end end ``` + \n The content of the LuaScript needs to be a whole function including both declaration and implementation. \n The parameters will be supplied by the system: - observedObj: the object represents the configuration that is observed from a specific @@ -100,14 +100,14 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to discover the resource's replica as well as resource requirements - \n The script should implement a function as follows: luaScript: - > function GetReplicas(desiredObj) replica = desiredObj.spec.replicas - requirement = {} requirement.nodeClaim = {} requirement.nodeClaim.nodeSelector - = desiredObj.spec.template.spec.nodeSelector requirement.nodeClaim.tolerations - = desiredObj.spec.template.spec.tolerations requirement.resourceRequest - = desiredObj.spec.template.spec.containers[1].resources.limits - return replica, requirement end \n The content of the LuaScript - needs to be a whole function including both declaration + \n The script should implement a function as follows: \n + ``` luaScript: > function GetReplicas(desiredObj) replica + = desiredObj.spec.replicas requirement = {} requirement.nodeClaim + = {} requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector + requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations + requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits + return replica, requirement end ``` \n The content of the + LuaScript needs to be a whole function including both declaration and implementation. \n The parameters will be supplied by the system: - desiredObj: the object represents the configuration to be applied to the member cluster. \n The function expects @@ -130,12 +130,12 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to revise replicas in the desired specification. The script - should implement a function as follows: luaScript: > function - ReviseReplica(desiredObj, desiredReplica) desiredObj.spec.replicas - = desiredReplica return desiredObj end \n The content of - the LuaScript needs to be a whole function including both - declaration and implementation. \n The parameters will be - supplied by the system: - desiredObj: the object represents + should implement a function as follows: \n ``` luaScript: + > function ReviseReplica(desiredObj, desiredReplica) desiredObj.spec.replicas + = desiredReplica return desiredObj end ``` \n The content + of the LuaScript needs to be a whole function including + both declaration and implementation. \n The parameters will + be supplied by the system: - desiredObj: the object represents the configuration to be applied to the member cluster. - desiredReplica: the replica number should be applied with. \n The returned object should be a revised configuration @@ -157,17 +157,17 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to retain runtime values to the desired specification. \n - The script should implement a function as follows: luaScript: - > function Retain(desiredObj, observedObj) desiredObj.spec.fieldFoo - = observedObj.spec.fieldFoo return desiredObj end \n The - content of the LuaScript needs to be a whole function including - both declaration and implementation. \n The parameters will - be supplied by the system: - desiredObj: the object represents - the configuration to be applied to the member cluster. - - observedObj: the object represents the configuration that - is observed from a specific member cluster. \n The returned - object should be a retained configuration which will be - applied to member cluster eventually." + The script should implement a function as follows: \n ``` + luaScript: > function Retain(desiredObj, observedObj) desiredObj.spec.fieldFoo + = observedObj.spec.fieldFoo return desiredObj end ``` \n + The content of the LuaScript needs to be a whole function + including both declaration and implementation. \n The parameters + will be supplied by the system: - desiredObj: the object + represents the configuration to be applied to the member + cluster. - observedObj: the object represents the configuration + that is observed from a specific member cluster. \n The + returned object should be a retained configuration which + will be applied to member cluster eventually." type: string required: - luaScript @@ -182,11 +182,11 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to aggregate decentralized statuses to the desired specification. - The script should implement a function as follows: luaScript: - > function AggregateStatus(desiredObj, statusItems) for - i = 1, #statusItems do desiredObj.status.readyReplicas = - desiredObj.status.readyReplicas + items[i].readyReplicas - end return desiredObj end \n The content of the LuaScript + The script should implement a function as follows: \n ``` + luaScript: > function AggregateStatus(desiredObj, statusItems) + for i = 1, #statusItems do desiredObj.status.readyReplicas + = desiredObj.status.readyReplicas + items[i].readyReplicas + end return desiredObj end ``` \n The content of the LuaScript needs to be a whole function including both declaration and implementation. \n The parameters will be supplied by the system: - desiredObj: the object represents a resource @@ -206,15 +206,16 @@ spec: luaScript: description: "LuaScript holds the Lua script that is used to get the status from the observed specification. The script - should implement a function as follows: luaScript: > function - ReflectStatus(observedObj) status = {} status.readyReplicas - = observedObj.status.observedObj return status end \n The - content of the LuaScript needs to be a whole function including - both declaration and implementation. \n The parameters will - be supplied by the system: - observedObj: the object represents - the configuration that is observed from a specific member - cluster. \n The returned status could be the whole status - or part of it and will be set into both Work and ResourceBinding(ClusterResourceBinding)." + should implement a function as follows: \n ``` luaScript: + > function ReflectStatus(observedObj) status = {} status.readyReplicas + = observedObj.status.observedObj return status end ``` \n + The content of the LuaScript needs to be a whole function + including both declaration and implementation. \n The parameters + will be supplied by the system: - observedObj: the object + represents the configuration that is observed from a specific + member cluster. \n The returned status could be the whole + status or part of it and will be set into both Work and + ResourceBinding(ClusterResourceBinding)." type: string required: - luaScript diff --git a/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go b/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go index d86eb6c15..e89f18e2c 100644 --- a/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go +++ b/pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go @@ -139,11 +139,14 @@ type LocalValueRetention struct { // to the desired specification. // // The script should implement a function as follows: - // luaScript: > - // function Retain(desiredObj, observedObj) - // desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo - // return desiredObj - // end + // + // ``` + // luaScript: > + // function Retain(desiredObj, observedObj) + // desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo + // return desiredObj + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -167,16 +170,19 @@ type ReplicaResourceRequirement struct { // replica as well as resource requirements // // The script should implement a function as follows: - // luaScript: > - // function GetReplicas(desiredObj) - // replica = desiredObj.spec.replicas - // requirement = {} - // requirement.nodeClaim = {} - // requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector - // requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations - // requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits - // return replica, requirement - // end + // + // ``` + // luaScript: > + // function GetReplicas(desiredObj) + // replica = desiredObj.spec.replicas + // requirement = {} + // requirement.nodeClaim = {} + // requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector + // requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations + // requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits + // return replica, requirement + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -198,11 +204,14 @@ type ReplicaResourceRequirement struct { type ReplicaRevision struct { // LuaScript holds the Lua script that is used to revise replicas in the desired specification. // The script should implement a function as follows: - // luaScript: > - // function ReviseReplica(desiredObj, desiredReplica) - // desiredObj.spec.replicas = desiredReplica - // return desiredObj - // end + // + // ``` + // luaScript: > + // function ReviseReplica(desiredObj, desiredReplica) + // desiredObj.spec.replicas = desiredReplica + // return desiredObj + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -222,12 +231,15 @@ type ReplicaRevision struct { type StatusReflection struct { // LuaScript holds the Lua script that is used to get the status from the observed specification. // The script should implement a function as follows: - // luaScript: > - // function ReflectStatus(observedObj) - // status = {} - // status.readyReplicas = observedObj.status.observedObj - // return status - // end + // + // ``` + // luaScript: > + // function ReflectStatus(observedObj) + // status = {} + // status.readyReplicas = observedObj.status.observedObj + // return status + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -247,13 +259,16 @@ type StatusAggregation struct { // LuaScript holds the Lua script that is used to aggregate decentralized statuses // to the desired specification. // The script should implement a function as follows: - // luaScript: > - // function AggregateStatus(desiredObj, statusItems) - // for i = 1, #statusItems do - // desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas - // end - // return desiredObj - // end + // + // ``` + // luaScript: > + // function AggregateStatus(desiredObj, statusItems) + // for i = 1, #statusItems do + // desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas + // end + // return desiredObj + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -273,12 +288,15 @@ type HealthInterpretation struct { // LuaScript holds the Lua script that is used to assess the health state of // a specific resource. // The script should implement a function as follows: - // luaScript: > - // function InterpretHealth(observedObj) - // if observedObj.status.readyReplicas == observedObj.spec.replicas then - // return true - // end - // end + // + // ``` + // luaScript: > + // function InterpretHealth(observedObj) + // if observedObj.status.readyReplicas == observedObj.spec.replicas then + // return true + // end + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. @@ -299,20 +317,23 @@ type DependencyInterpretation struct { // LuaScript holds the Lua script that is used to interpret the dependencies of // a specific resource. // The script should implement a function as follows: - // luaScript: > - // function GetDependencies(desiredObj) - // dependencies = {} - // if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= "default" then - // dependency = {} - // dependency.apiVersion = "v1" - // dependency.kind = "ServiceAccount" - // dependency.name = desiredObj.spec.serviceAccountName - // dependency.namespace = desiredObj.namespace - // dependencies[1] = {} - // dependencies[1] = dependency - // end - // return dependencies - // end + // + // ``` + // luaScript: > + // function GetDependencies(desiredObj) + // dependencies = {} + // if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= "default" then + // dependency = {} + // dependency.apiVersion = "v1" + // dependency.kind = "ServiceAccount" + // dependency.name = desiredObj.spec.serviceAccountName + // dependency.namespace = desiredObj.namespace + // dependencies[1] = {} + // dependencies[1] = dependency + // end + // return dependencies + // end + // ``` // // The content of the LuaScript needs to be a whole function including both // declaration and implementation. diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index cef9c1d3d..e0416fa10 100755 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -1805,7 +1805,7 @@ func schema_pkg_apis_config_v1alpha1_DependencyInterpretation(ref common.Referen Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to interpret the dependencies of a specific resource. The script should implement a function as follows:\n luaScript: >\n function GetDependencies(desiredObj)\n dependencies = {}\n if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= \"default\" then\n dependency = {}\n dependency.apiVersion = \"v1\"\n dependency.kind = \"ServiceAccount\"\n dependency.name = desiredObj.spec.serviceAccountName\n dependency.namespace = desiredObj.namespace\n dependencies[1] = {}\n dependencies[1] = dependency\n end\n return dependencies\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe returned value should be expressed by a slice of DependentObjectReference.", + Description: "LuaScript holds the Lua script that is used to interpret the dependencies of a specific resource. The script should implement a function as follows:\n\n```\n luaScript: >\n function GetDependencies(desiredObj)\n dependencies = {}\n if desiredObj.spec.serviceAccountName ~= nil and desiredObj.spec.serviceAccountName ~= \"default\" then\n dependency = {}\n dependency.apiVersion = \"v1\"\n dependency.kind = \"ServiceAccount\"\n dependency.name = desiredObj.spec.serviceAccountName\n dependency.namespace = desiredObj.namespace\n dependencies[1] = {}\n dependencies[1] = dependency\n end\n return dependencies\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe returned value should be expressed by a slice of DependentObjectReference.", Default: "", Type: []string{"string"}, Format: "", @@ -1879,7 +1879,7 @@ func schema_pkg_apis_config_v1alpha1_HealthInterpretation(ref common.ReferenceCa Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to assess the health state of a specific resource. The script should implement a function as follows:\n luaScript: >\n function InterpretHealth(observedObj)\n if observedObj.status.readyReplicas == observedObj.spec.replicas then\n return true\n end\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned boolean value indicates the health status.", + Description: "LuaScript holds the Lua script that is used to assess the health state of a specific resource. The script should implement a function as follows:\n\n```\n luaScript: >\n function InterpretHealth(observedObj)\n if observedObj.status.readyReplicas == observedObj.spec.replicas then\n return true\n end\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned boolean value indicates the health status.", Default: "", Type: []string{"string"}, Format: "", @@ -1901,7 +1901,7 @@ func schema_pkg_apis_config_v1alpha1_LocalValueRetention(ref common.ReferenceCal Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to retain runtime values to the desired specification.\n\nThe script should implement a function as follows:\n luaScript: >\n function Retain(desiredObj, observedObj)\n desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned object should be a retained configuration which will be applied to member cluster eventually.", + Description: "LuaScript holds the Lua script that is used to retain runtime values to the desired specification.\n\nThe script should implement a function as follows:\n\n```\n luaScript: >\n function Retain(desiredObj, observedObj)\n desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned object should be a retained configuration which will be applied to member cluster eventually.", Default: "", Type: []string{"string"}, Format: "", @@ -1923,7 +1923,7 @@ func schema_pkg_apis_config_v1alpha1_ReplicaResourceRequirement(ref common.Refer Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to discover the resource's replica as well as resource requirements\n\nThe script should implement a function as follows:\n luaScript: >\n function GetReplicas(desiredObj)\n replica = desiredObj.spec.replicas\n requirement = {}\n requirement.nodeClaim = {}\n requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector\n requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations\n requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits\n return replica, requirement\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe function expects two return values:\n - replica: the declared replica number\n - requirement: the resource required by each replica expressed with a\n ResourceBindingSpec.ReplicaRequirements.\nThe returned values will be set into a ResourceBinding or ClusterResourceBinding.", + Description: "LuaScript holds the Lua script that is used to discover the resource's replica as well as resource requirements\n\nThe script should implement a function as follows:\n\n```\n luaScript: >\n function GetReplicas(desiredObj)\n replica = desiredObj.spec.replicas\n requirement = {}\n requirement.nodeClaim = {}\n requirement.nodeClaim.nodeSelector = desiredObj.spec.template.spec.nodeSelector\n requirement.nodeClaim.tolerations = desiredObj.spec.template.spec.tolerations\n requirement.resourceRequest = desiredObj.spec.template.spec.containers[1].resources.limits\n return replica, requirement\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n\nThe function expects two return values:\n - replica: the declared replica number\n - requirement: the resource required by each replica expressed with a\n ResourceBindingSpec.ReplicaRequirements.\nThe returned values will be set into a ResourceBinding or ClusterResourceBinding.", Default: "", Type: []string{"string"}, Format: "", @@ -1945,7 +1945,7 @@ func schema_pkg_apis_config_v1alpha1_ReplicaRevision(ref common.ReferenceCallbac Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to revise replicas in the desired specification. The script should implement a function as follows:\n luaScript: >\n function ReviseReplica(desiredObj, desiredReplica)\n desiredObj.spec.replicas = desiredReplica\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - desiredReplica: the replica number should be applied with.\n\nThe returned object should be a revised configuration which will be applied to member cluster eventually.", + Description: "LuaScript holds the Lua script that is used to revise replicas in the desired specification. The script should implement a function as follows:\n\n```\n luaScript: >\n function ReviseReplica(desiredObj, desiredReplica)\n desiredObj.spec.replicas = desiredReplica\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents the configuration to be applied\n to the member cluster.\n - desiredReplica: the replica number should be applied with.\n\nThe returned object should be a revised configuration which will be applied to member cluster eventually.", Default: "", Type: []string{"string"}, Format: "", @@ -2637,7 +2637,7 @@ func schema_pkg_apis_config_v1alpha1_StatusAggregation(ref common.ReferenceCallb Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to aggregate decentralized statuses to the desired specification. The script should implement a function as follows:\n luaScript: >\n function AggregateStatus(desiredObj, statusItems)\n for i = 1, #statusItems do\n desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas\n end\n return desiredObj\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents a resource template.\n - statusItems: the slice of status expressed with AggregatedStatusItem.\n\nThe returned object should be a whole object with status aggregated.", + Description: "LuaScript holds the Lua script that is used to aggregate decentralized statuses to the desired specification. The script should implement a function as follows:\n\n```\n luaScript: >\n function AggregateStatus(desiredObj, statusItems)\n for i = 1, #statusItems do\n desiredObj.status.readyReplicas = desiredObj.status.readyReplicas + items[i].readyReplicas\n end\n return desiredObj\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - desiredObj: the object represents a resource template.\n - statusItems: the slice of status expressed with AggregatedStatusItem.\n\nThe returned object should be a whole object with status aggregated.", Default: "", Type: []string{"string"}, Format: "", @@ -2659,7 +2659,7 @@ func schema_pkg_apis_config_v1alpha1_StatusReflection(ref common.ReferenceCallba Properties: map[string]spec.Schema{ "luaScript": { SchemaProps: spec.SchemaProps{ - Description: "LuaScript holds the Lua script that is used to get the status from the observed specification. The script should implement a function as follows:\n luaScript: >\n function ReflectStatus(observedObj)\n status = {}\n status.readyReplicas = observedObj.status.observedObj\n return status\n end\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned status could be the whole status or part of it and will be set into both Work and ResourceBinding(ClusterResourceBinding).", + Description: "LuaScript holds the Lua script that is used to get the status from the observed specification. The script should implement a function as follows:\n\n```\n luaScript: >\n function ReflectStatus(observedObj)\n status = {}\n status.readyReplicas = observedObj.status.observedObj\n return status\n end\n```\n\nThe content of the LuaScript needs to be a whole function including both declaration and implementation.\n\nThe parameters will be supplied by the system:\n - observedObj: the object represents the configuration that is observed\n from a specific member cluster.\n\nThe returned status could be the whole status or part of it and will be set into both Work and ResourceBinding(ClusterResourceBinding).", Default: "", Type: []string{"string"}, Format: "",