derailed/k9s · error
resource is not restartable
Error message
resource is not restartable
What it means
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.
Source
Thrown at internal/view/restart_extender.go:89
}
}
return true
},
Cancel: func() {},
}
dialog.ShowRestart(&d, r.App().Content.Pages, &opts)
return nil
}
func (r *RestartExtender) restartRollout(ctx context.Context, path string, opts *metav1.PatchOptions) error {
res, err := dao.AccessorFor(r.App().factory, r.GVR())
if err != nil {
return err
}
s, ok := res.(dao.Restartable)
if !ok {
return errors.New("resource is not restartable")
}
return s.Restart(ctx, path, opts)
}
// Helpers...
func singularize(s string) string {
if strings.LastIndex(s, "s") == len(s)-1 {
return s[:len(s)-1]
}
return s
}
View on GitHub (pinned to 2d3ccc6ba2)
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
Defensive patterns
Strategy: type-guard
Type guard
func isRestartable(f dao.Factory, gvr *client.GVR) bool {
a, err := dao.AccessorFor(f, gvr)
_, ok := a.(dao.Restartable)
return err == nil && ok
} Try / catch
if _, ok := res.(dao.Restartable); !ok {
return errors.New("resource is not restartable")
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- expecting a switchable resource
- expecting a switchable resource
- expecting a job runner resource for %q
- expecting a ContainsPodSpec for %q but got %T
- expecting a nuker for %q
AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15).
Data as JSON: /api/errors/23531505efae0d06.
Report an issue: GitHub.