{"record":{"id":"f7d958348882cf75","repo":"derailed/k9s","slug":"unsupported-resource-q","errorCode":null,"errorMessage":"unsupported resource %q","messagePattern":"unsupported resource %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/view/command.go","lineNumber":159,"sourceCode":"\tv.SetFilter(filter, true)\n\n\treturn c.exec(p, client.AliGVR, v, false, pushCmd)\n}\n\nfunc (c *Command) xrayCmd(p *cmd.Interpreter, pushCmd bool) error {\n\targ, cns, ok := p.XrayArgs()\n\tif !ok {\n\t\treturn errors.New(\"invalid command. use `xray xxx`\")\n\t}\n\tif c.alias == nil {\n\t\treturn fmt.Errorf(\"no connection available\")\n\t}\n\tgvr, ok := c.alias.Resolve(cmd.NewInterpreter(arg))\n\tif !ok {\n\t\treturn fmt.Errorf(\"invalid resource name: %q\", arg)\n\t}\n\tif !allowedXRay(gvr) {\n\t\treturn fmt.Errorf(\"unsupported resource %q\", arg)\n\t}\n\tns := c.app.Config.ActiveNamespace()\n\tif cns != \"\" {\n\t\tns = cns\n\t}\n\tif err := c.app.Config.SetActiveNamespace(client.CleanseNamespace(ns)); err != nil {\n\t\treturn err\n\t}\n\tif err := c.app.switchNS(ns); err != nil {\n\t\treturn err\n\t}\n\n\treturn c.exec(p, client.XGVR, NewXray(gvr), true, pushCmd)\n}\n\n// Run execs the command by showing associated display.\nfunc (c *Command) run(p *cmd.Interpreter, fqn string, clearStack, pushCmd bool) error {\n\tif c.specialCmd(p, pushCmd) {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/command.go#L141-L177","documentation":"The argument resolved to a GVR, but allowedXRay(gvr) is false: xray is only implemented for a fixed set of workload-ish resources (the allowedCmds set — pods, services, deployments, daemonsets, statefulsets, replicasets and friends). Any other resource, even valid ones like jobs or nodes, is rejected.","triggerScenarios":"Running xray on resources outside the allowlist, e.g. `xray no` (nodes), `xray job`, `xray cm`, or a CRD. The resolver succeeds, then the set-membership check fails.","commonSituations":"Users assuming xray works for all resources; custom resources that resemble workloads; version changes that shrink/shift the allowlist.","solutions":["Use xray only on supported resources: pods, services, deployments, daemonsets, statefulsets, replicasets (see allowedCmds).","For other resources, browse normally or use owner/reference navigation instead of xray.","If you control a fork, extend the allowedCmds set and implement the xray view for the GVR."],"exampleFix":"# before\n:xray nodes\n\n# after\n:xray po","handlingStrategy":"validation","validationCode":"gvr, ok := c.alias.Resolve(cmd.NewInterpreter(arg))\nif ok && !allowedXRay(gvr) {\n    return fmt.Errorf(\"xray supports only %v\", allowedCmds.List())\n}","typeGuard":"func xraySupported(gvr *client.GVR) bool { return allowedCmds.Has(gvr) }","tryCatchPattern":null,"preventionTips":["Treat xray as workload-centric: pods/services/workload controllers only.","Check allowedCmds membership before building the xray UI.","For other resources use owner/ref navigation instead."],"tags":["xray","allowlist","command","usage"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}