{"record":{"id":"23531505efae0d06","repo":"derailed/k9s","slug":"resource-is-not-restartable","errorCode":null,"errorMessage":"resource is not restartable","messagePattern":"resource is not restartable","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/view/restart_extender.go","lineNumber":89,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\t\tCancel: func() {},\n\t}\n\tdialog.ShowRestart(&d, r.App().Content.Pages, &opts)\n\n\treturn nil\n}\n\nfunc (r *RestartExtender) restartRollout(ctx context.Context, path string, opts *metav1.PatchOptions) error {\n\tres, err := dao.AccessorFor(r.App().factory, r.GVR())\n\tif err != nil {\n\t\treturn err\n\t}\n\ts, ok := res.(dao.Restartable)\n\tif !ok {\n\t\treturn errors.New(\"resource is not restartable\")\n\t}\n\n\treturn s.Restart(ctx, path, opts)\n}\n\n// Helpers...\n\nfunc singularize(s string) string {\n\tif strings.LastIndex(s, \"s\") == len(s)-1 {\n\t\treturn s[:len(s)-1]\n\t}\n\n\treturn s\n}\n","sourceCodeStart":71,"sourceCodeEnd":104,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/restart_extender.go#L71-L104","documentation":"Returned by `RestartExtender.restartRollout` (internal/view/restart_extender.go:~89). The restart action loads the DAO for the view's GVR and asserts `dao.Restartable`; resources whose DAO does not implement a rollout-restart (custom resources, most built-ins outside deployment/statefulset/daemonset) reject the action. It is a capability check: the selected GVR has no restart semantics in k9s.","triggerScenarios":"Triggering the restart dialog/action (ctrl-r) on a resource whose DAO accessor does not implement dao.Restartable — e.g. CRD-backed custom resources or built-ins without a restartable DAO.","commonSituations":"Users try to restart arbitrary CRDs (operators' custom kinds) or resources like replicasets, expecting kubectl-rollout behavior; extension views added by forks without a Restart implementation.","solutions":["Use restart only on resources that support it: deployments, statefulsets, daemonsets","For custom resources, restart via the operator's own mechanism or delete the pods so the controller recreates them","Forks: implement dao.Restartable (Restart(ctx, path, opts) error) on your custom DAO to enable the action","Check the view's key hints — restart is only bound where it is supported"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func isRestartable(f dao.Factory, gvr *client.GVR) bool {\n    a, err := dao.AccessorFor(f, gvr)\n    _, ok := a.(dao.Restartable)\n    return err == nil && ok\n}","tryCatchPattern":"if _, ok := res.(dao.Restartable); !ok {\n    return errors.New(\"resource is not restartable\")\n}","preventionTips":["Bind the restart key only for restartable GVRs","Implement dao.Restartable on custom DAOs that should support it","Restart via pod deletion for operator-managed CRs"],"tags":["kubernetes","rollout","dao","type-assertion","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}