{"record":{"id":"60e0a0186db00a95","repo":"kubernetes/kops","slug":"building-compute-api-client-w","errorCode":null,"errorMessage":"building compute API client: %w","messagePattern":"building compute API client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops-controller/controllers/gceipam.go","lineNumber":52,"sourceCode":")\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\n\tlog logr.Logger\n\n\t// coreV1Client is a client-go client for patching nodes\n\tcoreV1Client *corev1client.CoreV1Client\n\n\t// gceClient is a client for GCE","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops-controller/controllers/gceipam.go#L34-L70","documentation":"NewGCEIPAMReconciler builds the GCE compute service client from ambient credentials (Application Default Credentials); this wraps compute.NewService failing, meaning no usable GCP credentials could be found or the environment is misconfigured.","triggerScenarios":"Thrown at cmd/kops-controller/controllers/gceipam.go:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide GCP credentials via a mounted service-account key or Workload Identity","Verify GOOGLE_APPLICATION_CREDENTIALS or the ADC metadata server is available","Ensure the service account has compute read permissions"],"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-12T12:17:11.808Z"}