Skip to content

Commit

Permalink
Extract all deamonsets of Cilium
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Ungureanu <ungureanuvladvictor@gmil.com>
  • Loading branch information
Vlad Ungureanu authored and michi-covalent committed Apr 29, 2022
1 parent 12aada8 commit a1f0417
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sysdump/sysdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,20 +485,20 @@ func (c *Collector) Run() error {
},
},
{
Description: "Collecting the Cilium daemonset",
Description: "Collecting the Cilium daemonset(s)",
Quick: true,
Task: func(ctx context.Context) error {
v, err := c.Client.ListDaemonSet(ctx, c.Options.CiliumNamespace, metav1.ListOptions{
LabelSelector: c.Options.CiliumDaemonSetSelector,
})
if err != nil {
return fmt.Errorf("failed to collect the Cilium daemonset: %w", err)
return fmt.Errorf("failed to list Cilium daemonsets: %w", err)
}
if len(v.Items) == 0 {
return fmt.Errorf("failed to find Cilium daemonset with label %q in namespace %q", c.Options.CiliumDaemonSetSelector, c.Options.CiliumNamespace)
return fmt.Errorf("failed to find Cilium daemonsets with label %q in namespace %q", c.Options.CiliumDaemonSetSelector, c.Options.CiliumNamespace)
}
if err = c.WriteYAML(ciliumDaemonSetFileName, &v.Items[0]); err != nil {
return fmt.Errorf("failed to collect the Cilium daemonset: %w", err)
if err = c.WriteYAML(ciliumDaemonSetFileName, v); err != nil {
return fmt.Errorf("failed to collect the Cilium daemonsets: %w", err)
}
return nil
},
Expand Down

0 comments on commit a1f0417

Please sign in to comment.