Skip to content

Commit

Permalink
Added option for JSON output for karmor probe
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <aryan1126.sharma@gmail.com>
  • Loading branch information
Aryan-sharma11 committed Jun 28, 2023
1 parent b5edf3b commit 372c01e
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 97 deletions.
8 changes: 4 additions & 4 deletions cmd/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ and what KubeArmor features will be supported e.g: observability, enforcement, e
If KubeArmor is running, It probes which environment KubeArmor is running on (e.g: systemd mode, kubernetes etc.),
the supported KubeArmor features in the environment, the pods being handled by KubeArmor and the policies running on each of these pods`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := probe.PrintProbeResult(client, probeInstallOptions); err != nil {
return err
}
return nil

err := probe.PrintProbeResult(client, probeInstallOptions)
return err

},
}
Expand All @@ -35,4 +34,5 @@ func init() {
probeCmd.Flags().StringVarP(&probeInstallOptions.Namespace, "namespace", "n", "kube-system", "Namespace for resources")
probeCmd.Flags().BoolVar(&probeInstallOptions.Full, "full", false, `If KubeArmor is not running, it deploys a daemonset to have access to more
information on KubeArmor support in the environment and deletes daemonset after probing`)
probeCmd.Flags().StringVarP(&probeInstallOptions.Output, "format", "f", "text", " Format: json or text ")
}
2 changes: 1 addition & 1 deletion install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func checkPods(c *k8s.Client, o Options) {
fmt.Print("⚠️\tFailed verifying KubeArmor functionality ...")
return
}
probeData, err := probe.ProbeRunningKubeArmorNodes(c, probe.Options{
probeData, _, err := probe.ProbeRunningKubeArmorNodes(c, probe.Options{
Namespace: o.Namespace,
})
if err != nil || len(probeData) == 0 {
Expand Down
Loading

0 comments on commit 372c01e

Please sign in to comment.