{"record":{"id":"f046153ed597c1e0","repo":"derailed/k9s","slug":"expecting-a-nuker-for-q","errorCode":null,"errorMessage":"expecting a nuker for %q","messagePattern":"expecting a nuker for %q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/view/pod.go","lineNumber":200,"sourceCode":"\t}\n\n\treturn nil\n}\n\nfunc (p *Pod) killCmd(evt *tcell.EventKey) *tcell.EventKey {\n\tselections := p.GetTable().GetSelectedItems()\n\tif len(selections) == 0 {\n\t\treturn evt\n\t}\n\n\tres, err := dao.AccessorFor(p.App().factory, p.GVR())\n\tif err != nil {\n\t\tp.App().Flash().Err(err)\n\t\treturn nil\n\t}\n\tnuker, ok := res.(dao.Nuker)\n\tif !ok {\n\t\tp.App().Flash().Err(fmt.Errorf(\"expecting a nuker for %q\", p.GVR()))\n\t\treturn nil\n\t}\n\tif len(selections) > 1 {\n\t\tp.App().Flash().Infof(\"Delete %d marked %s\", len(selections), p.GVR())\n\t} else {\n\t\tp.App().Flash().Infof(\"Delete resource %s %s\", p.GVR(), selections[0])\n\t}\n\tp.GetTable().ShowDeleted()\n\tfor _, path := range selections {\n\t\tif err := nuker.Delete(context.Background(), path, nil, dao.NowGrace); err != nil {\n\t\t\tp.App().Flash().Errf(\"Delete failed with %s\", err)\n\t\t} else {\n\t\t\tp.App().factory.DeleteForwarder(path)\n\t\t}\n\t\tp.GetTable().DeleteMark(path)\n\t}\n\tp.Refresh()\n","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/pod.go#L182-L218","documentation":"The Pod viewer's delete command (internal/view/pod.go:200) resolves the DAO for its GVR and type-asserts it to dao.Nuker (the interface providing Delete with propagation/grace). If the accessor registered for that GVR does not implement Delete, the assertion fails and the delete is aborted with this error.","triggerScenarios":"Pressing ctrl-d on a resource whose DAO accessor is a generic implementation without Delete — typically a custom/aliased GVR routed to the pod viewer, or a fork where a DAO was replaced with one that no longer satisfies dao.Nuker.","commonSituations":"Custom resource viewers built on the pod browser; k9s upgrades where the dao.Nuker interface signature changed (e.g. grace period parameter added) breaking older custom DAOs; readonly-ish DAOs deliberately omitting Delete.","solutions":["Delete via kubectl instead: 'kubectl delete <resource> <name> -n <ns>'","If this is a custom DAO, implement dao.Nuker: Delete(ctx, path, propagation, grace) error","Verify the DAO registered in the registry for the GVR is the intended one (dao.AccessorFor lookup)","Check k9s is not in readonly mode / custom GVR aliasing is not misrouting the viewer"],"exampleFix":"// before\ntype MyDAO struct{ dao.Generic }\n// ctrl-d -> expecting a nuker for \"pods\"\n\n// after\ntype MyDAO struct{ dao.Generic }\n\nfunc (d *MyDAO) Delete(ctx context.Context, path string, propagation *metav1.DeletionPropagation, grace dao.Grace) error {\n  return d.Generic.Delete(ctx, path, propagation, grace)\n}","handlingStrategy":"type-guard","validationCode":"// gate the delete action on the DAO capability at bind time\nres, err := dao.AccessorFor(p.App().factory, p.GVR())\nif err != nil { return }\nif _, ok := res.(dao.Nuker); !ok {\n    // do not bind ctrl-d for this viewer\n    return\n}","typeGuard":"func isNuker(res dao.Resource) bool {\n    _, ok := res.(dao.Nuker)\n    return ok\n}","tryCatchPattern":"// comma-ok assert, never panic; surface a flash and abort the command\nnuker, ok := res.(dao.Nuker)\nif !ok {\n    p.App().Flash().Err(fmt.Errorf(\"expecting a nuker for %q\", p.GVR()))\n    return nil\n}","preventionTips":["In custom DAOs add compile-time checks: var _ dao.Nuker = (*MyDAO)(nil)","Bind destructive keys only for viewers whose resources support deletion","After k9s upgrades, re-verify custom DAOs still satisfy current dao interfaces"],"tags":["k9s","delete","dao","type-assertion","kubernetes"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}