Skip to content

Commit

Permalink
[DROP] debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicbozzuto committed Oct 21, 2024
1 parent f33d5c5 commit 17c0241
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cluster-autoscaler/core/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package core

import (
kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes"
"strings"
"time"

Expand Down Expand Up @@ -76,6 +77,8 @@ type Autoscaler interface {
LastScaleUpTime() time.Time
// LastScaleUpTime is a time of the last scale down
LastScaleDownDeleteTime() time.Time

GetListerRegistry() kube_util.ListerRegistry
}

// NewAutoscaler creates an autoscaler of an appropriate type according to the parameters
Expand Down
4 changes: 4 additions & 0 deletions cluster-autoscaler/core/static_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ type StaticAutoscaler struct {
taintConfig taints.TaintConfig
}

func (a *StaticAutoscaler) GetListerRegistry() kube_util.ListerRegistry {
return a.ListerRegistry
}

type staticAutoscalerProcessorCallbacks struct {
disableScaleDownForLoop bool
extraValues map[string]interface{}
Expand Down
3 changes: 3 additions & 0 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
// additional informers might have been registered in the factory during NewAutoscaler.
stop := make(chan struct{})
informerFactory.Start(stop)
p, err := autoscaler.GetListerRegistry().AllPodLister().List()
klog.V(1).Infof("Initial list call: %v (%v)", p, err)

klog.V(1).Info("Started shared informer factory, waiting for initial cache sync")

syncStart := time.Now()
Expand Down

0 comments on commit 17c0241

Please sign in to comment.