- if dsList.Items == nil || len(dsList.Items) == 0 {
- return rmap, errors.NewNotFound(corev1.Resource("daemonset"), "DaemonSet")
- }
-
- rmap.ConfigMap = &cmList.Items[0]
- rmap.DaemonSet = &dsList.Items[0]
-
- return rmap, err
-}
-
-// GetCollectdPluginList returns the list of CollectdPlugin instances in the namespace ns
-func GetCollectdPluginList(rc client.Client, ns string) (*onapv1alpha1.CollectdPluginList, error) {
- // Get all collectd plugins in the current namespace to rebuild conf.
- collectdPlugins := &onapv1alpha1.CollectdPluginList{}
- cpOpts := &client.ListOptions{}
- cpOpts.InNamespace(ns)
- err := rc.List(context.TODO(), cpOpts, collectdPlugins)
- if err != nil {
- return nil, err
- }
- return collectdPlugins, nil