Skip to content

Commit

Permalink
Change function name
Browse files Browse the repository at this point in the history
Signed-off-by: Omer Aplatony <[email protected]>
  • Loading branch information
omerap12 committed Feb 4, 2025
1 parent 86eb551 commit 13fb008
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (feeder *clusterStateFeeder) GarbageCollectCheckpoints() {
// 1. `vpaObjectNamespace` is set and matches the current namespace.
// 2. `ignoredNamespaces` is set, but the current namespace is not in the list.
// 3. Neither `vpaObjectNamespace` nor `ignoredNamespaces` is set, so all namespaces are included.
if !feeder.shouldCleanupNamespace(namespace) {
if feeder.shouldIgnoreNamespace(namespace) {
klog.V(3).InfoS("Skipping namespace; it does not meet cleanup criteria", "namespace", namespace, "vpaObjectNamespace", feeder.vpaObjectNamespace, "ignoredNamespaces", feeder.ignoredNamespaces)
continue
}
Expand All @@ -319,16 +319,16 @@ func (feeder *clusterStateFeeder) GarbageCollectCheckpoints() {
}
}

func (feeder *clusterStateFeeder) shouldCleanupNamespace(namespace string) bool {
func (feeder *clusterStateFeeder) shouldIgnoreNamespace(namespace string) bool {
// 1. `vpaObjectNamespace` is set but doesn't match the current namespace.
if feeder.vpaObjectNamespace != "" && namespace != feeder.vpaObjectNamespace {
return false
return true
}
// 2. `ignoredNamespaces` is set, and the current namespace is in the list.
if len(feeder.ignoredNamespaces) > 0 && slices.Contains(feeder.ignoredNamespaces, namespace) {
return false
return true
}
return true
return false
}

func (feeder *clusterStateFeeder) cleanupCheckpointsForNamespace(namespace string, allVPAKeys map[model.VpaID]bool) error {
Expand Down

0 comments on commit 13fb008

Please sign in to comment.