mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-28 16:31:50 +00:00
feat: wip fixing missing details
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit is contained in:
33
README.md
33
README.md
@@ -31,11 +31,36 @@ K8sGPT uses analyzers to triage and diagnose issues in your cluster. It has a se
|
||||
## Usage
|
||||
|
||||
```
|
||||
# Ensure KUBECONFIG env is set to an active Kubernetes cluster
|
||||
Kubernetes debugging powered by AI
|
||||
|
||||
Usage:
|
||||
k8sgpt [command]
|
||||
|
||||
Available Commands:
|
||||
analyze This command will find problems within your Kubernetes cluster
|
||||
auth Authenticate with your chosen backend
|
||||
completion Generate the autocompletion script for the specified shell
|
||||
help Help about any command
|
||||
|
||||
```
|
||||
|
||||
_Run a scan with the default analyzers_
|
||||
|
||||
```
|
||||
k8sgpt auth
|
||||
k8sgpt find problems
|
||||
# for more detail
|
||||
k8s find problems --explain
|
||||
k8sgpt analyze --explain
|
||||
```
|
||||
|
||||
_Filter on resource_
|
||||
|
||||
```
|
||||
k8sgpt analyze --explain --resource=Service
|
||||
```
|
||||
|
||||
_Output to JSON_
|
||||
|
||||
```
|
||||
k8sgpt analyze --explain --resource=Service --output=json
|
||||
```
|
||||
|
||||
## Upcoming major milestones
|
||||
|
@@ -89,6 +89,11 @@ var AnalyzeCmd = &cobra.Command{
|
||||
if len(*analysisResults) > 0 {
|
||||
bar = progressbar.Default(int64(len(*analysisResults)))
|
||||
}
|
||||
|
||||
// This variable is used to store the results that will be printed
|
||||
// It's necessary because the heap memory is lost when the function returns
|
||||
var printOutput []analyzer.Analysis
|
||||
|
||||
for _, analysis := range *analysisResults {
|
||||
|
||||
if explain {
|
||||
@@ -100,10 +105,11 @@ var AnalyzeCmd = &cobra.Command{
|
||||
analysis.Details = parsedText
|
||||
bar.Add(1)
|
||||
}
|
||||
printOutput = append(printOutput, analysis)
|
||||
}
|
||||
|
||||
// print results
|
||||
for n, analysis := range *analysisResults {
|
||||
for n, analysis := range printOutput {
|
||||
|
||||
switch output {
|
||||
case "json":
|
||||
|
Reference in New Issue
Block a user