forked from openshift/osde2e
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholm.go
More file actions
29 lines (24 loc) · 811 Bytes
/
olm.go
File metadata and controls
29 lines (24 loc) · 811 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
package helper
import (
"fmt"
"github.com/openshift/osde2e/pkg/common/runner"
)
// InspectOLM inspects the OLM state of the cluster and saves the state to disk for later debugging
func (h *H) InspectOLM() error {
inspectTimeoutInSeconds := 200
h.SetServiceAccount("system:serviceaccount:%s:cluster-admin")
r := h.Runner(fmt.Sprintf("oc adm inspect --dest-dir=%v -A olm", runner.DefaultRunner.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
}