Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions test/e2e/monitoring_stack_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func TestMonitoringStackController(t *testing.T) {
}, {
name: "resource selector nil propagates to Prometheus",
scenario: nilResrouceSelectorPropagatesToPrometheus,
}, {
name: "prometheus with nil resource selector becomes ready",
scenario: nilResourceSelectorPrometheusBecomesReady,
}, {
name: "stack spec are reflected in Prometheus",
scenario: reconcileStack,
Expand Down Expand Up @@ -174,6 +177,21 @@ func nilResrouceSelectorPropagatesToPrometheus(t *testing.T) {
}
}

func nilResourceSelectorPrometheusBecomesReady(t *testing.T) {
ms := newMonitoringStack(t, "nil-selector-ready")
ms.Spec.ResourceSelector = nil

err := f.K8sClient.Create(context.Background(), ms)
assert.NilError(t, err, "failed to create monitoring stack with nil resourceSelector")

// Verify Prometheus CR is created
f.AssertResourceEventuallyExists(ms.Name, ms.Namespace, &monv1.Prometheus{})(t)

// Verify Prometheus pods become ready despite nil resourceSelector
// covers upstream issue #932
f.AssertStatefulsetReady("prometheus-"+ms.Name, ms.Namespace, framework.WithTimeout(5*time.Minute))(t)
}

func promConfigDefaultsAreApplied(t *testing.T) {
tests := []struct {
name string
Expand Down