Skip to content

Commit

Permalink
Adds GatherMachineConfigPools
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcell Sevcsik committed Oct 9, 2020
1 parent ada9d27 commit 9b5b919
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/gather/clusterconfig/clusterconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func (i *Gatherer) Gather(ctx context.Context, recorder record.Interface) error
GatherHostSubnet(i),
GatherMachineSet(i),
GatherServiceAccounts(i),
GatherMachineConfigPool(i),
)
}

Expand Down Expand Up @@ -816,6 +817,29 @@ func GatherMachineSet(i *Gatherer) func() ([]record.Record, []error) {
}
}


//GatherMachineConfigPool
func GatherMachineConfigPool(i *Gatherer) func() ([]record.Record, []error) {
return func() ([]record.Record, []error) {
mcp := schema.GroupVersionResource{Group: "machineconfiguration.openshift.io", Version: "v1", Resource: "machineconfigpools"}
machineCPs, err := i.dynamicClient.Resource(mcp).List(i.ctx, metav1.ListOptions{})
if errors.IsNotFound(err) {
return nil, nil
}
if err != nil {
return nil, []error{err}
}
records := []record.Record{}
for _, i := range machineCPs.Items {
records = append(records, record.Record{
Name: fmt.Sprintf("machineconfigpools/%s", i.GetName()),
Item: record.JSONMarshaller{Object: i.Object},
})
}
return records, nil
}
}

func (i *Gatherer) gatherNamespaceEvents(namespace string) ([]record.Record, []error) {
// do not accidentally collect events for non-openshift namespace
if !strings.HasPrefix(namespace, "openshift-") {
Expand Down

0 comments on commit 9b5b919

Please sign in to comment.