{"record":{"id":"f390a84112b41322","repo":"derailed/k9s","slug":"resource-s-is-not-valuer","errorCode":null,"errorMessage":"resource %s is not Valuer","messagePattern":"resource (.+?) is not Valuer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/model/values.go","lineNumber":62,"sourceCode":"// Init initializes the model.\nfunc (v *Values) Init(f dao.Factory) error {\n\tv.factory = f\n\n\tvar err error\n\tv.lines, err = v.getValues()\n\n\treturn err\n}\n\nfunc (v *Values) getValues() ([]string, error) {\n\taccessor, err := dao.AccessorFor(v.factory, v.gvr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvaluer, ok := accessor.(dao.Valuer)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"resource %s is not Valuer\", v.gvr)\n\t}\n\n\tvalues, err := valuer.GetValues(v.path, v.allValues)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn strings.Split(string(values), \"\\n\"), nil\n}\n\n// GVR returns the resource gvr.\nfunc (v *Values) GVR() *client.GVR {\n\treturn v.gvr\n}\n\n// ToggleValues toggles between user supplied values and computed values.\nfunc (v *Values) ToggleValues() error {\n\tv.allValues = !v.allValues","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/model/values.go#L44-L80","documentation":"Values.getValues resolves the DAO accessor for a GVR and requires dao.Valuer (GetValues). Resources whose accessor doesn't implement it cannot serve a values view (the decoded key/value listing used for ConfigMaps and Secrets).","triggerScenarios":"Opening the values view on a resource that is not ConfigMap/Secret-like: Deployments, Pods, Services, CRDs — any accessor without GetValues(path, allValues).","commonSituations":"Pressing the values shortcut on an arbitrary resource in k9s; custom resources expected to behave like config carriers.","solutions":["Use the values view on ConfigMap or Secret resources","For a custom resource that stores key/value data, implement GetValues on its DAO to satisfy dao.Valuer","Otherwise view the resource YAML (ToYAML) instead of a values listing"],"exampleFix":"// before: values on a Deployment accessor\nvaluer, ok := accessor.(dao.Valuer) // ok == false\n\n// after: guard and route\nif valuer, ok := accessor.(dao.Valuer); ok {\n    values, err := valuer.GetValues(path, all)\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func valuerFor(factory dao.Factory, gvr *client.GVR) (dao.Valuer, bool) {\n    accessor, err := dao.AccessorFor(factory, gvr)\n    if err != nil { return nil, false }\n    v, ok := accessor.(dao.Valuer)\n    return v, ok\n}","tryCatchPattern":"vals, err := v.getValues()\nif err != nil && strings.Contains(err.Error(), \"is not Valuer\") {\n    return nil, fmt.Errorf(\"%w — values view applies to ConfigMap/Secret-like resources\", err)\n}","preventionTips":["Offer the values action only for config-carrying GVRs (configmaps, secrets, custom config CRDs implementing GetValues)","Implement dao.Valuer on custom config resources so the view works uniformly"],"tags":["kubernetes","values","interface","dao","k9s"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}