@@ -164,6 +164,7 @@ func (i *Gatherer) Gather(ctx context.Context, recorder record.Interface) error
164
164
GatherHostSubnet (i ),
165
165
GatherMachineSet (i ),
166
166
GatherServiceAccounts (i ),
167
+ GatherMachineConfigPool (i ),
167
168
)
168
169
}
169
170
@@ -816,6 +817,29 @@ func GatherMachineSet(i *Gatherer) func() ([]record.Record, []error) {
816
817
}
817
818
}
818
819
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
+
819
843
func (i * Gatherer ) gatherNamespaceEvents (namespace string ) ([]record.Record , []error ) {
820
844
// do not accidentally collect events for non-openshift namespace
821
845
if ! strings .HasPrefix (namespace , "openshift-" ) {
0 commit comments