Skip to content

Commit

Permalink
Merge pull request #6391 from voelzmo/fix/vpa-e2e-tests
Browse files Browse the repository at this point in the history
Fix VPA e2e test failures
  • Loading branch information
k8s-ci-robot authored Jan 22, 2024
2 parents df0ce2d + 1740647 commit ed25db1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions vertical-pod-autoscaler/e2e/v1/full_vpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ var _ = FullVpaE2eDescribe("Pods under VPA with non-recognized recommender expli
containerName := GetHamsterContainerNameByIndex(0)
vpaCRD := test.VerticalPodAutoscaler().
WithName("hamster-vpa").
WithRecommender("non-recognized").
WithNamespace(f.Namespace.Name).
WithTargetRef(targetRef).
WithContainer(containerName).
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion vertical-pod-autoscaler/pkg/utils/test/test_vpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ func (b *verticalPodAutoscalerBuilder) Get() *vpa_types.VerticalPodAutoscaler {
Mode: b.scalingMode[containerName],
})
}
recommendation = b.recommendation.WithContainer(b.containerNames[0]).Get()
// VPAs with a single container may still use the old/implicit way of adding recommendations
r := b.recommendation.WithContainer(b.containerNames[0]).Get()
if r.ContainerRecommendations[0].Target != nil {
recommendation = r
}

recommendation.ContainerRecommendations = append(recommendation.ContainerRecommendations, b.appendedRecommendations...)

return &vpa_types.VerticalPodAutoscaler{
Expand Down

0 comments on commit ed25db1

Please sign in to comment.