Feat: support customizing application revision limit number in policy (#5995)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
Somefive
2023-05-16 16:12:37 +08:00
committed by GitHub
parent 1af82cd282
commit da8588c887
7 changed files with 96 additions and 2 deletions

View File

@@ -27,6 +27,10 @@ const (
// GarbageCollectPolicySpec defines the spec of configuration drift
type GarbageCollectPolicySpec struct {
// ApplicationRevisionLimit if set, this application will use this number for application revision instead of
// the global configuration
ApplicationRevisionLimit *int `json:"applicationRevisionLimit,omitempty"`
// KeepLegacyResource if is set, outdated versioned resourcetracker will not be recycled automatically
// outdated resources will be kept until resourcetracker be deleted manually
KeepLegacyResource bool `json:"keepLegacyResource,omitempty"`

View File

@@ -329,6 +329,11 @@ func (in *GarbageCollectPolicyRule) DeepCopy() *GarbageCollectPolicyRule {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicySpec) DeepCopyInto(out *GarbageCollectPolicySpec) {
*out = *in
if in.ApplicationRevisionLimit != nil {
in, out := &in.ApplicationRevisionLimit, &out.ApplicationRevisionLimit
*out = new(int)
**out = **in
}
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]GarbageCollectPolicyRule, len(*in))