Skip to content

Commit

Permalink
e2e: dump rbacv1 resources in case of failure
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Sep 19, 2024
1 parent c5f7088 commit b376fea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/util/k8sreporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/k8snetworkplumbingwg/sriov-network-operator/test/util/namespaces"

monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
rbacv1 "k8s.io/api/rbac/v1"
)

func New(reportPath string) (*kniK8sReporter.KubernetesReporter, error) {
Expand All @@ -25,6 +26,12 @@ func New(reportPath string) (*kniK8sReporter.KubernetesReporter, error) {
if err != nil {
return err
}

err = rbacv1.AddToScheme(s)
if err != nil {
return err
}

Check failure on line 34 in test/util/k8sreporter/reporter.go

View workflow job for this annotation

GitHub Actions / Golangci-lint

File is not `gofmt`-ed with `-s` (gofmt)
return nil
}

Expand Down Expand Up @@ -58,6 +65,8 @@ func New(reportPath string) (*kniK8sReporter.KubernetesReporter, error) {
{Cr: &sriovv1.SriovOperatorConfigList{}},
{Cr: &monitoringv1.ServiceMonitorList{}, Namespace: &operatorNamespace},
{Cr: &monitoringv1.PrometheusRuleList{}, Namespace: &operatorNamespace},
{Cr: &rbacv1.RoleList{}, Namespace: &operatorNamespace},
{Cr: &rbacv1.RoleBindingList{}, Namespace: &operatorNamespace},
}

err := os.Mkdir(reportPath, 0755)
Expand Down

0 comments on commit b376fea

Please sign in to comment.