#!/bin/bash

# resource list
resources=()

# sriov network operator namespace
resources+=(ns/openshift-sriov-network-operator)

# openshift multus namespace
resources+=(ns/openshift-multus)

# other sriov network operator related namespaces
resources+=(ns/openshift-marketplace)

# sriovnetwork.openshift.io
resources+=(sriovnetworknodepolicies sriovnetworknodestates sriovnetworks sriovoperatorconfigs)

# net-attch-def
resources+=(network-attachment-definitions)

# machine/node resources
resources+=(nodes machineconfigs machineconfigpools featuregates kubeletconfigs)

# run the collection of resources using must-gather
for resource in ${resources[@]}; do
  /usr/bin/oc adm inspect --dest-dir must-gather --all-namespaces ${resource}
done

exit 0
