-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7416987
commit 785c3e9
Showing
16 changed files
with
299 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package collect | ||
|
||
import ( | ||
"github.com/replicatedhq/troubleshoot/pkg/redact" | ||
) | ||
|
||
func redactMap(input map[string][]byte) (map[string][]byte, error) { | ||
result := make(map[string][]byte) | ||
for k, v := range input { | ||
redacted, err := redact.Redact(v) | ||
if err != nil { | ||
return nil, err | ||
} | ||
result[k] = redacted | ||
} | ||
return result, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package collect | ||
|
||
import ( | ||
// "bytes" | ||
// "encoding/json" | ||
// "fmt" | ||
// "io" | ||
// "strings" | ||
// "time" | ||
|
||
troubleshootv1beta1 "github.com/replicatedhq/troubleshoot/pkg/apis/troubleshoot/v1beta1" | ||
// corev1 "k8s.io/api/core/v1" | ||
// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
// "k8s.io/client-go/kubernetes" | ||
// "sigs.k8s.io/controller-runtime/pkg/client/config" | ||
) | ||
|
||
type RunOutput struct { | ||
PodLogs map[string][]byte `json:"run/,omitempty"` | ||
} | ||
|
||
func Run(runCollector *troubleshootv1beta1.Run, redact bool) error { | ||
// cfg, err := config.GetConfig() | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// client, err := kubernetes.NewForConfig(cfg) | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// pods, err := listPodsInSelectors(client, logsCollector.Namespace, logsCollector.Selector) | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// logsOutput := LogsOutput{ | ||
// PodLogs: make(map[string][]byte), | ||
// } | ||
// for _, pod := range pods { | ||
// podLogs, err := getPodLogs(client, pod, logsCollector.Limits) | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// for k, v := range podLogs { | ||
// logsOutput.PodLogs[k] = v | ||
// } | ||
// } | ||
|
||
// b, err := json.MarshalIndent(logsOutput, "", " ") | ||
// if err != nil { | ||
// return err | ||
// } | ||
|
||
// fmt.Printf("%s\n", b) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.