{"record":{"id":"59c0b5d3227d3465","repo":"kubernetes/kops","slug":"building-corev1-client-w","errorCode":null,"errorMessage":"building corev1 client: %w","messagePattern":"building corev1 client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops-controller/controllers/gceipam.go","lineNumber":46,"sourceCode":"\tapierrors \"k8s.io/apimachinery/pkg/api/errors\"\n\tcorev1client \"k8s.io/client-go/kubernetes/typed/core/v1\"\n\t\"k8s.io/klog/v2\"\n\tctrl \"sigs.k8s.io/controller-runtime\"\n\t\"sigs.k8s.io/controller-runtime/pkg/client\"\n\t\"sigs.k8s.io/controller-runtime/pkg/manager\"\n)\n\n// NewGCEIPAMReconciler is the constructor for a GCEIPAMReconciler\nfunc NewGCEIPAMReconciler(mgr manager.Manager) (*GCEIPAMReconciler, error) {\n\tklog.Info(\"starting gce ipam controller\")\n\tr := &GCEIPAMReconciler{\n\t\tclient: mgr.GetClient(),\n\t\tlog:    ctrl.Log.WithName(\"controllers\").WithName(\"gce-ipam\"),\n\t}\n\n\tcoreClient, err := corev1client.NewForConfig(mgr.GetConfig())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"building corev1 client: %w\", err)\n\t}\n\tr.coreV1Client = coreClient\n\n\tgceClient, err := compute.NewService(context.Background())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"building compute API client: %w\", err)\n\t}\n\tr.gceClient = gceClient\n\n\treturn r, nil\n}\n\n// GCEIPAMReconciler observes Node objects, assigning their `PodCIDRs` from the instance's `ExternalIpv6`.\ntype GCEIPAMReconciler struct {\n\t// client is the controller-runtime client\n\tclient client.Client\n\n\t// log is a logr","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/controllers/gceipam.go#L28-L64","documentation":"NewGCEIPAMReconciler builds a typed corev1 client from the controller-runtime manager's REST config; this wraps that construction failing. The manager config itself was already established, so this is essentially an internal client-go setup error (e.g. invalid auth fields).","triggerScenarios":"Thrown at cmd/kops-controller/controllers/gceipam.go:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped client-go error for the invalid config field","Verify the controller manager's REST config/credentials are valid","Restart kops-controller after fixing credential or kubeconfig issues"],"exampleFix":null,"handlingStrategy":"try-catch","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"}