{"record":{"id":"f9418e0e7adc30be","repo":"derailed/k9s","slug":"you-must-provide-a-selection","errorCode":null,"errorMessage":"you must provide a selection","messagePattern":"you must provide a selection","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/view/dp.go","lineNumber":55,"sourceCode":"\t\t\t),\n\t\t),\n\t)\n\td.AddBindKeysFn(d.bindKeys)\n\td.GetTable().SetEnterFn(d.showPods)\n\n\treturn &d\n}\n\nfunc (d *Deploy) bindKeys(aa *ui.KeyActions) {\n\taa.Bulk(ui.KeyMap{\n\t\tui.KeyZ: ui.NewKeyAction(\"ReplicaSets\", d.replicaSetsCmd, true),\n\t})\n}\n\nfunc (d *Deploy) logOptions(prev bool) (*dao.LogOptions, error) {\n\tpath := d.GetTable().GetSelectedItem()\n\tif path == \"\" {\n\t\treturn nil, errors.New(\"you must provide a selection\")\n\t}\n\tdp, err := d.getInstance(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn podLogOptions(d.App(), path, prev, &dp.ObjectMeta, &dp.Spec.Template.Spec), nil\n}\n\nfunc (d *Deploy) replicaSetsCmd(evt *tcell.EventKey) *tcell.EventKey {\n\tdName := d.GetTable().GetSelectedItem()\n\tif dName == \"\" {\n\t\treturn evt\n\t}\n\tdp, err := d.getInstance(dName)\n\tif err != nil {\n\t\td.App().Flash().Err(err)\n\t\treturn nil","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/dp.go#L37-L73","documentation":"Returned by `Deploy.logOptions` (internal/view/dp.go:~55) when the deployments table has no selected item. The logs shortcut must resolve a concrete deployment to build pod log options from its pod template; an empty selection aborts with this message.","triggerScenarios":"Pressing the logs key on the deployments view with no row selected — empty deployment list (filtered namespace has none), active filter hiding all rows, or no highlight at keypress time.","commonSituations":"Namespace has zero deployments; user applies a label filter that excludes everything; selection lost right after context/namespace switch.","solutions":["Ensure a deployment row is highlighted before pressing the logs key","Clear filters (`/` + Esc) that may hide all rows","If the list is empty, switch to a namespace that actually has deployments (check with `kubectl get deploy -A`)","Select a pod directly in the pod view if you only need pod logs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if d.GetTable().GetSelectedItem() == \"\" {\n    d.App().Flash().Warnf(\"You must select a deployment\")\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Select a row before pressing log keys","Verify deployments exist in the namespace","Remove filters that hide all rows"],"tags":["ui","selection","logs","deployment","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}