Skip to content

Commit

Permalink
feat: add activation feature for CPU/Memory scaler
Browse files Browse the repository at this point in the history
Signed-off-by: kunwooy <[email protected]>
  • Loading branch information
kunwooy committed Oct 11, 2024
1 parent 584202f commit c8f6e16
Show file tree
Hide file tree
Showing 37 changed files with 6,847 additions and 76 deletions.
5 changes: 4 additions & 1 deletion controllers/keda/scaledobject_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,13 +790,16 @@ var _ = Describe("ScaledObjectController", func() {
Eventually(func() error {
return k8sClient.Get(context.Background(), types.NamespacedName{Name: getHPAName(so), Namespace: "default"}, hpa)
}).ShouldNot(HaveOccurred())

averageUtilization := int32(100)
hpa.Status.CurrentMetrics = []autoscalingv2.MetricStatus{
{
Type: autoscalingv2.ResourceMetricSourceType,
Resource: &autoscalingv2.ResourceMetricStatus{
Name: corev1.ResourceCPU,
Current: autoscalingv2.MetricValueStatus{
Value: resource.NewQuantity(int64(100), resource.DecimalSI),
Value: resource.NewQuantity(int64(100), resource.DecimalSI),
AverageUtilization: &averageUtilization,
},
},
},
Expand Down
Loading

0 comments on commit c8f6e16

Please sign in to comment.