-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy patholm.go
More file actions
31 lines (25 loc) · 868 Bytes
/
olm.go
File metadata and controls
31 lines (25 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package helper
import (
"context"
"fmt"
"github.com/openshift/osde2e/pkg/common/mainjobrunner"
)
// InspectOLM inspects the OLM state of the cluster and saves the state to disk for later debugging
func (h *H) InspectOLM(ctx context.Context) error {
inspectTimeoutInSeconds := 200
h.SetServiceAccount(ctx, "system:serviceaccount:%s:cluster-admin")
r := h.Runner(fmt.Sprintf("oc adm inspect --dest-dir=%v -A olm", mainjobrunner.DefaultMainJobRunner.OutputDir))
r.Name = "olm-inspect"
r.Tarball = true
stopCh := make(chan struct{})
err := r.Run(inspectTimeoutInSeconds, stopCh)
if err != nil {
return fmt.Errorf("error running OLM inspection: %s", err.Error())
}
gatherResults, err := r.RetrieveResults()
if err != nil {
return fmt.Errorf("error retrieving OLM inspection results: %s", err.Error())
}
h.WriteResults(gatherResults)
return nil
}