Skip to content

Commit

Permalink
service_test: added test for defining a subset on Tortoise
Browse files Browse the repository at this point in the history
  • Loading branch information
Dymanik authored Sep 23, 2024
1 parent e885474 commit 1c5a04b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions pkg/vpa/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,48 @@ func Test_isMonitorVPAReady(t *testing.T) {
},
},
},
{
name: "Tortoise defines less containers than VPA, VPA is Ready",
args: args{
vpa: &vpav1.VerticalPodAutoscaler{
Status: vpav1.VerticalPodAutoscalerStatus{
Conditions: []vpav1.VerticalPodAutoscalerCondition{
{
Type: vpav1.RecommendationProvided,
Status: v1.ConditionFalse,
},
},
Recommendation: &vpav1.RecommendedPodResources{
ContainerRecommendations: []vpav1.RecommendedContainerResources{
{
ContainerName: "app",
Target: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("1Gi"),
v1.ResourceCPU: resource.MustParse("1"), // wrong
},
},
{
ContainerName: "istio",
Target: v1.ResourceList{
v1.ResourceMemory: resource.MustParse("1Gi"),
v1.ResourceCPU: resource.MustParse("1"),
},
},
},
},
},
},
tortoise: &autoscalingv1beta3.Tortoise{
Status: autoscalingv1beta3.TortoiseStatus{
AutoscalingPolicy: []autoscalingv1beta3.ContainerAutoscalingPolicy{
{
ContainerName: "app",
},
},
},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 1c5a04b

Please sign in to comment.