{"record":{"id":"3177dc85c4303df8","repo":"derailed/k9s","slug":"you-must-provide-a-selection-3177dc","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/ds.go","lineNumber":55,"sourceCode":"}\n\nfunc (d *DaemonSet) showPods(app *App, _ ui.Tabular, _ *client.GVR, path string) {\n\tvar res dao.DaemonSet\n\tres.Init(app.factory, d.GVR())\n\n\tds, err := res.GetInstance(path)\n\tif err != nil {\n\t\td.App().Flash().Err(err)\n\t\treturn\n\t}\n\n\tshowPodsFromSelector(app, path, ds.Spec.Selector)\n}\n\nfunc (d *DaemonSet) 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\tds, err := d.getInstance(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn podLogOptions(d.App(), path, prev, &ds.ObjectMeta, &ds.Spec.Template.Spec), nil\n}\n\nfunc (d *DaemonSet) getInstance(fqn string) (*appsv1.DaemonSet, error) {\n\tvar ds dao.DaemonSet\n\tds.Init(d.App().factory, client.DsGVR)\n\n\treturn ds.GetInstance(fqn)\n}\n","sourceCodeStart":37,"sourceCodeEnd":71,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/view/ds.go#L37-L71","documentation":"Returned by `DaemonSet.logOptions` (internal/view/ds.go:~55) when the daemonset table has no selected item. Log retrieval needs a daemonset name to derive pod-template log options; with GetSelectedItem()==\"\" it fails immediately.","triggerScenarios":"Pressing the logs key on the daemonsets view while no row is selected (empty list, filter hiding all rows, or no highlight).","commonSituations":"Namespace without daemonsets; heavy filters; pressing `l` immediately after entering the view.","solutions":["Highlight a daemonset row first, then press the logs key","Remove active filters that exclude all rows","Verify daemonsets exist: `kubectl get ds -n <ns>`","Fall back to pods view logs if you need logs from one node's pod"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if d.GetTable().GetSelectedItem() == \"\" {\n    d.App().Flash().Warnf(\"You must select a daemonset\")\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Select a row before pressing log keys","Check `kubectl get ds` for the namespace","Clear filters hiding rows"],"tags":["ui","selection","logs","daemonset","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}