{"record":{"id":"b1ecd1123e3c22ad","repo":"kubernetes/kops","slug":"creating-clientset-w-b1ecd1","errorCode":null,"errorMessage":"creating clientset: %w","messagePattern":"creating clientset: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/dump/resourcedumper.go","lineNumber":100,"sourceCode":"\tk8sConfig.QPS = 50\n\tk8sConfig.Burst = 100\n\tdynamicClient, err := dynamic.NewForConfig(k8sConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating dynamic client: %w\", err)\n\t}\n\treturn &resourceDumper{\n\t\tk8sConfig:     k8sConfig,\n\t\tdynamicClient: dynamicClient,\n\t\toutput:        output,\n\t\tartifactsDir:  artifactsDir,\n\t}, nil\n}\n\nfunc (d *resourceDumper) DumpResources(ctx context.Context) error {\n\tklog.Info(\"Dumping k8s resources\")\n\tclientSet, err := kubernetes.NewForConfig(d.k8sConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating clientset: %w\", err)\n\t}\n\n\tnamespaces, err := clientSet.CoreV1().Namespaces().List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listing namespaces: %w\", err)\n\t}\n\n\tdiscoveryClient, err := discovery.NewDiscoveryClientForConfig(d.k8sConfig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating discovery client: %w\", err)\n\t}\n\n\tresourceLists, err := discoveryClient.ServerPreferredResources()\n\tvar discoveryErr *discovery.ErrGroupDiscoveryFailed\n\tif errors.As(err, &discoveryErr) {\n\t\tklog.Warningf(\"using incomplete list of API groups: %v\", discoveryErr)\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"listing server preferred resources: %w\", err)","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/dump/resourcedumper.go#L82-L118","documentation":"Constructing the typed kubernetes.Clientset inside DumpResources failed from the same rest.Config the dynamic client already accepted; a defect in the config that only the typed client rejects (auth or TLS data).","triggerScenarios":"Thrown at pkg/dump/resourcedumper.go:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate kubeconfig","Check client certificate/token expiry","Verify API server reachability"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}