mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
25 lines
531 B
Go
25 lines
531 B
Go
package collect
|
|
|
|
import (
|
|
"encoding/json"
|
|
"path/filepath"
|
|
|
|
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1"
|
|
)
|
|
|
|
type DataOutput map[string][]byte
|
|
|
|
func Data(ctx *Context, dataCollector *troubleshootv1beta1.Data) ([]byte, error) {
|
|
bundlePath := filepath.Join(dataCollector.Name, dataCollector.CollectorName)
|
|
dataOutput := DataOutput{
|
|
bundlePath: []byte(dataCollector.Data),
|
|
}
|
|
|
|
b, err := json.MarshalIndent(dataOutput, "", " ")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return b, nil
|
|
}
|