Skip to content

Commit 41932a3

Browse files
author
Marcell Sevcsik
committed
1. draft
1 parent ada9d27 commit 41932a3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pkg/gather/clusterconfig/clusterconfig.go

+24
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func (i *Gatherer) Gather(ctx context.Context, recorder record.Interface) error
164164
GatherHostSubnet(i),
165165
GatherMachineSet(i),
166166
GatherServiceAccounts(i),
167+
GatherMachineConfigPool(i),
167168
)
168169
}
169170

@@ -816,6 +817,29 @@ func GatherMachineSet(i *Gatherer) func() ([]record.Record, []error) {
816817
}
817818
}
818819

820+
821+
//GatherMachineConfigPool
822+
func GatherMachineConfigPool(i *Gatherer) func() ([]record.Record, []error) {
823+
return func() ([]record.Record, []error) {
824+
mcp := schema.GroupVersionResource{Group: "machineconfiguration.openshift.io", Version: "v1", Resource: "machineconfigpool"}
825+
machineCPs, err := i.dynamicClient.Resource(mcp).List(i.ctx, metav1.ListOptions{})
826+
if errors.IsNotFound(err) {
827+
return nil, nil
828+
}
829+
if err != nil {
830+
return nil, []error{err}
831+
}
832+
records := []record.Record{}
833+
for _, i := range machineCPs.Items {
834+
records = append(records, record.Record{
835+
Name: fmt.Sprintf("machineconfigpools/%s", i.GetName()),
836+
Item: record.JSONMarshaller{Object: i.Object},
837+
})
838+
}
839+
return records, nil
840+
}
841+
}
842+
819843
func (i *Gatherer) gatherNamespaceEvents(namespace string) ([]record.Record, []error) {
820844
// do not accidentally collect events for non-openshift namespace
821845
if !strings.HasPrefix(namespace, "openshift-") {

0 commit comments

Comments
 (0)