{"record":{"id":"b911620ce4fe4ff0","repo":"derailed/k9s","slug":"expecting-a-scalable-resource-for-q","errorCode":null,"errorMessage":"expecting a scalable resource for %q","messagePattern":"expecting a scalable resource for %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/view/image_extender.go","lineNumber":187,"sourceCode":"\t\treturn nil, err\n\t}\n\tresourceWPodSpec, ok := res.(dao.ContainsPodSpec)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expecting a ContainsPodSpec for %q but got %T\", s.GVR(), res)\n\t}\n\n\treturn resourceWPodSpec.GetPodSpec(path)\n}\n\nfunc (s *ImageExtender) setImages(ctx context.Context, path string, imageSpecs dao.ImageSpecs) error {\n\tres, err := dao.AccessorFor(s.App().factory, s.GVR())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tresourceWPodSpec, ok := res.(dao.ContainsPodSpec)\n\tif !ok {\n\t\treturn fmt.Errorf(\"expecting a scalable resource for %q\", s.GVR())\n\t}\n\n\treturn resourceWPodSpec.SetImages(ctx, path, imageSpecs)\n}\n","sourceCodeStart":169,"sourceCodeEnd":192,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/image_extender.go#L169-L192","documentation":"ImageExtender.setImages() performs the same res.(dao.ContainsPodSpec) assertion before SetImages, but the message wrongly says 'expecting a scalable resource' — copy-paste from the scaler; the real requirement is ContainsPodSpec, not dao.Scalable. Functionally identical to error 235: the GVR's DAO cannot set images because it has no pod-spec support.","triggerScenarios":"Confirming an image change on a resource whose DAO lacks ContainsPodSpec — generic CRD accessors, non-workload resources, or misregistered plugins.","commonSituations":"Same as 235, hit at commit time instead of read time: reading the pod spec happened to be skipped or succeeded via a different path, then SetImages fails; users mislead by 'scalable' into debugging replicas they never touched.","solutions":["Ignore the 'scalable' wording — the fix is pod-spec support, not scale subresource access","Apply the same fixes as 235: use supported workloads or register a ContainsPodSpec DAO for the CRD","Upstream note: the message in image_extender.go should read 'expecting a ContainsPodSpec resource' — patch it if you build k9s from source"],"exampleFix":"// before (internal/view/image_extender.go) — misleading message\nreturn fmt.Errorf(\"expecting a scalable resource for %q\", s.GVR())\n// after — matches the actual interface requirement\nreturn fmt.Errorf(\"expecting a ContainsPodSpec resource for %q\", s.GVR())","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func canSetImages(res dao.Resource) (dao.ContainsPodSpec, bool) {\n    cps, ok := res.(dao.ContainsPodSpec)\n    return cps, ok\n}\n\nif cps, ok := canSetImages(res); !ok {\n    return fmt.Errorf(\"expecting a ContainsPodSpec resource for %q\", s.GVR()) // fixed wording\n} else {\n    return cps.SetImages(ctx, path, imageSpecs)\n}","tryCatchPattern":null,"preventionTips":["Same gate as 235: assert ContainsPodSpec before enabling the set-image action","Do not chase replicas — despite the wording, scalability is irrelevant to this failure","Fix the copy if you maintain a fork: the message should name ContainsPodSpec"],"tags":["kubernetes","k9s","type-assertion","images","error-message"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}