{"record":{"id":"da6431ed4fdbcce8","repo":"cilium/cilium","slug":"no-restclientgetter-for-helm-values","errorCode":null,"errorMessage":"no RESTClientGetter for Helm Values","messagePattern":"no RESTClientGetter for Helm Values","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/k8s/client.go","lineNumber":1150,"sourceCode":"\t\tif err == nil {\n\t\t\treturn &ver, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"unable to parse Kubernetes version (got %s): %w\", sv.String(), err)\n}\n\nfunc (c *Client) GetIngress(ctx context.Context, namespace string, name string, opts metav1.GetOptions) (*networkingv1.Ingress, error) {\n\treturn c.Clientset.NetworkingV1().Ingresses(namespace).Get(ctx, name, opts)\n}\n\nfunc (c *Client) CreateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress, opts metav1.CreateOptions) (*networkingv1.Ingress, error) {\n\treturn c.Clientset.NetworkingV1().Ingresses(namespace).Create(ctx, ingress, opts)\n}\n\n// GetHelmValues is the function for cilium cli sysdump to collect the helm values from the release directly\nfunc (c *Client) GetHelmValues(_ context.Context, releaseName string, namespace string) (string, error) {\n\tif c.RESTClientGetter == nil {\n\t\treturn \"\", fmt.Errorf(\"no RESTClientGetter for Helm Values\")\n\t}\n\thelmDriver := \"\"\n\tactionConfig := action.Configuration{}\n\tif err := actionConfig.Init(c.RESTClientGetter, namespace, helmDriver); err != nil {\n\t\treturn \"\", err\n\t}\n\thelmGetValsClient := action.NewGetValues(&actionConfig)\n\tvals, err := helmGetValsClient.Run(releaseName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to retrieve helm value from release %s: %w\", releaseName, err)\n\t}\n\n\tvaluesBuf := new(bytes.Buffer)\n\tif err = output.EncodeYAML(valuesBuf, vals); err != nil {\n\t\treturn \"\", fmt.Errorf(\"unable to parse helm values from release %s: %w\", releaseName, err)\n\t}\n\treturn valuesBuf.String(), nil\n}","sourceCodeStart":1132,"sourceCodeEnd":1168,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/k8s/client.go#L1132-L1168","documentation":"Returned by `Client.GetHelmValues` when `c.RESTClientGetter` is nil. This function is used by cilium-cli sysdump to read Helm release values directly from the cluster; Helm's `action.Configuration.Init` requires a RESTClientGetter to build its Kubernetes client, and the Client was constructed without one (e.g. client created only from a kubeconfig without the getter stored, or a slim/agent client instance).","triggerScenarios":"Calling `GetHelmValues(ctx, releaseName, namespace)` on a `k8s.Client` built without a RESTClientGetter — e.g. created via constructors that leave the field unset (default client creation paths, test clients) while the sysdump tries to collect Helm values.","commonSituations":"Running `cilium-cli sysdump` with a client created programmatically rather than through the CLI's normal client-initialization; unit tests instantiating k8s.Client directly; refactors dropping the `WithRESTClientGetter`-style option.","solutions":["Construct the client so RESTClientGetter is populated (the genericclioptions ConfigFlags used for the rest of cilium-cli)","Upgrade cilium-cli — ensure you're not using an older/different client-construction path","As a workaround, retrieve values via `helm get values <release> -n <namespace>` outside cilium-cli","Guard the call: check RESTClientGetter availability before invoking GetHelmValues"],"exampleFix":"// before\nclient, err := k8s.NewClient(...) // RESTClientGetter unset\nclient.GetHelmValues(ctx, \"cilium\", \"kube-system\") // error\n// after\nclient, err := k8s.NewClient(\n    k8s.WithRESTClientGetter(configFlags), // pass the ConfigFlags used for kubeconfig access\n)\nclient.GetHelmValues(ctx, \"cilium\", \"kube-system\")","handlingStrategy":"validation","validationCode":"if client.RESTClientGetter == nil {\n    return errors.New(\"helm operations unavailable: client was built without a RESTClientGetter\")\n}","typeGuard":"func supportsHelm(c *k8s.Client) bool {\n    return c != nil && c.RESTClientGetter != nil\n}","tryCatchPattern":"vals, err := client.GetHelmValues(ctx, release, ns)\nif err != nil && strings.Contains(err.Error(), \"no RESTClientGetter\") {\n    // fall back to helm CLI or skip the helm-values section of the sysdump\n    log.Warn(\"skipping helm values collection: client lacks RESTClientGetter\")\n    return nil\n}","preventionTips":["Always construct k8s.Client via the standard CLI path that stores the ConfigFlags as RESTClientGetter","If building clients in tests, set RESTClientGetter explicitly","Check RESTClientGetter != nil before calling GetHelmValues/GetHelmMetadata","Document that Helm-based helpers are unavailable on getter-less clients"],"tags":["helm","kubernetes","configuration","cilium-cli"],"backgroundTag":"missing-rest-client-getter","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}