Don't create resource directories if not querying for resources
Ordering issue in the logic caused the paths to be created even
if the queries were noops. This adds an empty-check before
creating the directories at all.
Related to
@@ -137,6 +137,11 @@ func QueryResources(
ns *string,
cfg *config.Config) error {
+ // Early exit; avoid forming query or creating output directories.
+ if len(resources) == 0 {
+ return nil
+ }
+
if ns != nil {
logrus.Infof("Running ns query (%v)", *ns)
} else {
