mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-28 08:17:21 +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
|
## 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 auth
|
||||||
k8sgpt find problems
|
k8sgpt analyze --explain
|
||||||
# for more detail
|
```
|
||||||
k8s find problems --explain
|
|
||||||
|
_Filter on resource_
|
||||||
|
|
||||||
|
```
|
||||||
|
k8sgpt analyze --explain --resource=Service
|
||||||
|
```
|
||||||
|
|
||||||
|
_Output to JSON_
|
||||||
|
|
||||||
|
```
|
||||||
|
k8sgpt analyze --explain --resource=Service --output=json
|
||||||
```
|
```
|
||||||
|
|
||||||
## Upcoming major milestones
|
## Upcoming major milestones
|
||||||
|
@@ -89,6 +89,11 @@ var AnalyzeCmd = &cobra.Command{
|
|||||||
if len(*analysisResults) > 0 {
|
if len(*analysisResults) > 0 {
|
||||||
bar = progressbar.Default(int64(len(*analysisResults)))
|
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 {
|
for _, analysis := range *analysisResults {
|
||||||
|
|
||||||
if explain {
|
if explain {
|
||||||
@@ -100,10 +105,11 @@ var AnalyzeCmd = &cobra.Command{
|
|||||||
analysis.Details = parsedText
|
analysis.Details = parsedText
|
||||||
bar.Add(1)
|
bar.Add(1)
|
||||||
}
|
}
|
||||||
|
printOutput = append(printOutput, analysis)
|
||||||
}
|
}
|
||||||
|
|
||||||
// print results
|
// print results
|
||||||
for n, analysis := range *analysisResults {
|
for n, analysis := range printOutput {
|
||||||
|
|
||||||
switch output {
|
switch output {
|
||||||
case "json":
|
case "json":
|
||||||
|
Reference in New Issue
Block a user