Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Wang <kevinwzf0126@gmail.com>
  • Loading branch information
RainbowMango and kevin-wangzefeng authored Oct 18, 2022
1 parent 4623d8c commit a770f12
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkg/apis/config/v1alpha1/resourceinterpretercustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ type ResourceInterpreterCustomizationSpec struct {
// +required
Kind string `json:"kind"`

// Retention describes the rules about how to honor the changes on member clusters.
// This ensures that Karmada doesn't continually clear the generated fields
// from a resource, to avoid continual regeneration by the resource controller
// in the member cluster.
// For example, the replica of Deployment might be set by the HPA controller
// on member cluster, in this case, Karmada can retain the replicas with this
// configuration and doesn't try to correct it.
// Retention describes the desired behavior that karmada should react on
// the changes made by member cluster components. This avoids system
// running into a meaningless loop that Karmada resource controller and
// the member cluster component continually applying opposite values of a field.
// For example, the "replicas" of Deployment might be changed by the HPA
// controller on member cluster. In this case, Karmada should retain the "replicas"
// and not try to change it.
// +optional
Retention LocalValueRetention `json:"retention,omitempty"`
}
Expand All @@ -47,11 +47,11 @@ type ResourceInterpreterCustomizationSpec struct {
type LocalValueRetention struct {
// RetentionLua holds the Lua script that is used to retain runtime values to the desired specification.
// The script should implement a function as follows:
//
// function Retain(desiredObj, observedObj)
// desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo
// return desiredObj
// end
// retentionLua: >
// function Retain(desiredObj, observedObj)
// desiredObj.spec.fieldFoo = observedObj.spec.fieldFoo
// return desiredObj
// end
//
// RetentionLua only holds the function body part, take the `desiredObj` and `observedObj` as the function
// parameters or global variables, and finally returns a retained specification.
Expand Down

0 comments on commit a770f12

Please sign in to comment.