Skip to content

Commit 6604318

Browse files
committed
kubescore added
1 parent b5e4d9f commit 6604318

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

agent/kubviz/kube_score.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ func RunKubeScore(config *rest.Config, js nats.JetStreamContext) error {
2323
//defer wg.Done()
2424
var report []json_v2.ScoredObject
2525
cmd := fmt.Sprintf(`kubectl api-resources --verbs=list --namespaced -o name | xargs -n1 -I{} sh -c "kubectl get {} --all-namespaces -oyaml && echo ---" | kube-score score - -o json`)
26-
//log.Printf("Command: %#v,", cmd)
26+
log.Printf("Command: %s", cmd)
27+
28+
// Execute the command
2729
out, err := executeCommand(cmd)
2830
if err != nil {
29-
log.Printf("Error scanning image %s:", err)
31+
log.Printf("Error executing command: %s", err)
3032
return err
3133
}
3234

35+
// Log the output of the kubectl command
36+
log.Printf("kubectl Command Output: %s", out)
37+
38+
// Continue with the rest of the code...
3339
err = json.Unmarshal([]byte(out), &report)
3440
if err != nil {
3541
log.Printf("Error occurred while Unmarshalling json: %v", err)

0 commit comments

Comments
 (0)