Skip to content

cluster resources collector: replicasets output to wrong directory #1916

@cbuto

Description

@cbuto

Bug Description

The cluster resources collector is writing replicaset resources to a directory called statefulsets-errors.json, instead of replicasets.

i.e.

├── statefulsets
│   ├── cert-manager.json
│   ├── default.json
│   ├── kube-node-lease.json
│   ├── kube-public.json
│   ├── kube-system.json
│   └── local-path-storage.json
├── statefulsets-errors.json # these are replicasets
│   ├── cert-manager.json
│   ├── default.json
│   ├── kube-node-lease.json
│   ├── kube-public.json
│   ├── kube-system.json
│   └── local-path-storage.json

This also causes issues if there is an error during statefulset collection and a file is created called statefulsets-errors.json.

i.e.

Error: failed to run collect and analyze process: create bundle file: failed to stat file: lstat /var/folders/j8/9dmckpr53fsgt2ttnjvc8x1h0000gn/T/supportbundle3684131245/support-bundle-2025-10-28T14_47_51/cluster-resources/statefulsets-errors.json/default.json: not a directory
Error: failed to run collect and analyze process: create bundle file: failed to stat file: lstat /var/folders/j8/9dmckpr53fsgt2ttnjvc8x1h0000gn/T/supportbundle3684131245/support-bundle-2025-10-28T14_47_51/cluster-resources/statefulsets-errors.json/default.json: not a directory

Expected Behavior

the cluster resource collector should output replicasets to a directory called replicasets.

Steps To Reproduce

  1. Collect a support bundle kubectl support-bundle --auto
  2. Open the tarball and look for the directory called statefulsets-errors.json
  3. cat any json files in that directory and observe they are actually replicaset lists
cat cluster-resources/statefulsets-errors.json/default.json
{
  "kind": "ReplicaSetList",
  "apiVersion": "apps/v1",
  "metadata": {
    "resourceVersion": "233601"
  },
  "items": null
}

Additional Context

Include the following information.

  • Troubleshoot version. If you built from source, note that including the version of Go you used to build with: Replicated Troubleshoot 0.123.11
  • Operating system: MacOS
  • Operating system version
  • Other details that might be helpful in diagnosing the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions