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

  1. Use restart only on resources that support it: deployments, statefulsets, daemonsets
  2. For custom resources, restart via the operator's own mechanism or delete the pods so the controller recreates them
  3. Forks: implement dao.Restartable (Restart(ctx, path, opts) error) on your custom DAO to enable the action
  4. 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

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


AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15). Data as JSON: /api/errors/23531505efae0d06. Report an issue: GitHub.