Skip to content

Commit eb6e397

Browse files
test(operator): drop the incidental fixture from the no-pods case
The scaled-to-zero test seeded a spec-less LimitRange, which is not part of the case it names. It is the first application in the namespace that makes a workload with no pods invisible to a pod-only scan, so start from no LimitRange at all and let the assertion rest on the workload rather than on the fixture. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent f26379e commit eb6e397

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎internal/operator/package_reconciler_test.go‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -801,14 +801,12 @@ func TestReconcileSystemDefaultsLimitRangeSkipsWhenTheScanCannotRead(t *testing.
801801
func TestReconcileSystemDefaultsLimitRangeRaisesCeilingForWorkloadWithNoPods(t *testing.T) {
802802
scheme := limitRangeScheme(t)
803803

804-
existing := &corev1.LimitRange{
805-
ObjectMeta: metav1.ObjectMeta{
806-
Name: SystemDefaultsLimitRangeName,
807-
Namespace: "cozy-monitoring",
808-
},
809-
}
804+
// No LimitRange yet: this is the first application in the namespace, which is where
805+
// a scaled-to-zero workload is genuinely invisible to a pod-only scan. Seeding a
806+
// spec-less LimitRange instead would leave the case resting on that fixture rather
807+
// than on the workload having no pods.
810808
cl := fake.NewClientBuilder().WithScheme(scheme).
811-
WithObjects(existing, systemDeployment("vmalert", 0, "8Gi", "")).Build()
809+
WithObjects(systemDeployment("vmalert", 0, "8Gi", "")).Build()
812810

813811
r := &PackageReconciler{
814812
Client: cl,

0 commit comments

Comments
 (0)