ignore err if kubearmor daemonset not found

using `karmor sysdump` in the context of dev env causes problem since
kubearmor is not running in daemonset mode.

Signed-off-by: Rahul Jadhav <nyrahul@gmail.com>
This commit is contained in:
Rahul Jadhav 2022-07-13 11:40:08 +05:30
parent 4e82380e96
commit 967f195d44

View file

@ -68,7 +68,8 @@ func Collect(c *k8s.Client, o Options) error {
errs.Go(func() error {
v, err := c.K8sClientset.AppsV1().DaemonSets("kube-system").Get(context.Background(), "kubearmor", metav1.GetOptions{})
if err != nil {
return err
fmt.Printf("kubearmor daemonset not found. (possible if kubearmor is running in process mode)")
return nil
}
if err := writeYaml(path.Join(d, "kubearmor-daemonset.yaml"), v); err != nil {
return err