Skip to content

Commit

Permalink
fix: fix wrong test
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Fernandez <mariofer@redhat.com>
  • Loading branch information
marioferh committed Oct 20, 2023
1 parent 3ab03f5 commit 64a2309
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ roleRef:
name: monitoring-alertmanager-api-writer
subjects:
- kind: ServiceAccount
name: prometheus-user-workload
name: prometheus-user-workload
namespace: openshift-user-workload-monitoring
2 changes: 1 addition & 1 deletion jsonnet/components/prometheus-user-workload.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function(params)
},
subjects: [{
kind: 'ServiceAccount',
name: cfg.name,
name: 'prometheus-' + cfg.name,
namespace: cfg.namespace,
}],
},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/alertmanager_user_workload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func assertUWMAlertsAccess(t *testing.T) {
client := framework.NewPrometheusClient(host, token)

err = framework.Poll(5*time.Second, time.Minute, func() error {
resp, err := client.Do("GET", "/api/v2/rules", nil)
resp, err := client.Do("GET", "/api/v2/alerts", nil)
if err != nil {
return err
}
Expand All @@ -100,7 +100,7 @@ func assertUWMAlertsAccess(t *testing.T) {
return err
}

if resp.StatusCode == http.StatusOK {
if resp.StatusCode != http.StatusForbidden {
return fmt.Errorf("unexpected status code response, want different of %d, (%s)", http.StatusOK, framework.ClampMax(b))
}
return nil
Expand Down

0 comments on commit 64a2309

Please sign in to comment.