feat: add anonymization flag

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
Matthis Holleville
2023-04-09 23:37:29 +02:00
parent 9423b53c1d
commit d2a84ea2b5
17 changed files with 278 additions and 63 deletions

View File

@@ -2,6 +2,7 @@ package analyzer
import (
"fmt"
"github.com/k8sgpt-ai/k8sgpt/pkg/util"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@@ -19,7 +20,7 @@ func (ReplicaSetAnalyzer) Analyze(a Analyzer) ([]Result, error) {
var preAnalysis = map[string]PreAnalysis{}
for _, rs := range list.Items {
var failures []string
var failures []Failure
// Check for empty rs
if rs.Status.Replicas == 0 {
@@ -27,7 +28,11 @@ func (ReplicaSetAnalyzer) Analyze(a Analyzer) ([]Result, error) {
// Check through container status to check for crashes
for _, rsStatus := range rs.Status.Conditions {
if rsStatus.Type == "ReplicaFailure" && rsStatus.Reason == "FailedCreate" {
failures = []string{rsStatus.Message}
failures = append(failures, Failure{
Text: rsStatus.Message,
Sensitive: []Sensitive{},
})
}
}
}