From 78e3e6976875e02b95041aa14aacae8846b2e56b Mon Sep 17 00:00:00 2001 From: zwang7 Date: Wed, 26 May 2021 11:42:54 +0800 Subject: [PATCH] add container when init from history provider --- .../pkg/recommender/input/cluster_feeder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go b/vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go index 83081b6b5898..23b16657b1a5 100644 --- a/vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go +++ b/vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder.go @@ -239,6 +239,9 @@ func (feeder *clusterStateFeeder) InitFromHistoryProvider(historyProvider histor PodID: podID, ContainerName: containerName, } + if err = feeder.clusterState.AddOrUpdateContainer(containerID, nil); err != nil { + klog.Warningf("Failed to add container %+v. Reason: %+v", containerID, err) + } klog.V(4).Infof("Adding %d samples for container %v", len(sampleList), containerID) for _, sample := range sampleList { if err := feeder.clusterState.AddSample(