{"record":{"id":"d3db6e020f6f3a06","repo":"kubernetes/kubernetes","slug":"pod-specification-v-v","errorCode":null,"errorMessage":"pod specification (%v): %v","messagePattern":"pod specification \\((.+?)\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kube-controller-manager/app/plugins.go","lineNumber":151,"sourceCode":"\t\t\t\tfilteredPlugins = append(filteredPlugins, plugin)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn filteredPlugins, nil\n}\n\n// AttemptToLoadRecycler tries decoding a pod from a filepath for use as a recycler for a volume.\n// If successful, this method will set the recycler on the config.\n// If unsuccessful, an error is returned. Function is exported for reuse downstream.\nfunc AttemptToLoadRecycler(path string, config *volume.VolumeConfig) error {\n\tif path != \"\" {\n\t\trecyclerPod, err := volumeutil.LoadPodFromFile(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = volume.ValidateRecyclerPodTemplate(recyclerPod); err != nil {\n\t\t\treturn fmt.Errorf(\"pod specification (%v): %v\", path, err)\n\t\t}\n\t\tconfig.RecyclerPodTemplate = recyclerPod\n\t}\n\treturn nil\n}\n","sourceCodeStart":133,"sourceCodeEnd":157,"githubUrl":"https://github.com/kubernetes/kubernetes/blob/b882c60b4023bdf09264c2d5d30a2cadebc240fb/cmd/kube-controller-manager/app/plugins.go#L133-L157","documentation":"Thrown by AttemptToLoadRecycler (plugins.go:151) when a custom recycler pod template loaded from a file (PodTemplateFilePathHostPath or PodTemplateFilePathNFS) fails volume.ValidateRecyclerPodTemplate. The recycler is a pod used to wipe reclaimable PVs; the loaded pod spec must meet the recycler contract (correct image, service account, volumes, etc.). The %v placeholders are the file path and the underlying validation error.","triggerScenarios":"Configuring PersistentVolumeRecyclerConfiguration.PodTemplateFilePath{HostPath,NFS} to point at a JSON/YAML pod manifest that, once decoded, violates ValidateRecyclerPodTemplate (e.g. missing the recycler label, wrong restart policy, incompatible volume mounts).","commonSituations":"Customizing the volume recycler pod image or settings and providing a malformed template file; upgrading K8s where the recycler pod contract tightened; pointing the path at a stale file from an older cluster.","solutions":["Inspect the underlying ValidateRecyclerPodTemplate error (the second %v) and fix the pod manifest to satisfy the recycler contract.","If you do not need a custom recycler, clear PodTemplateFilePathHostPath/NFS to use volume.NewPersistentVolumeRecyclerPodTemplate default.","Validate the pod manifest decodes cleanly with kubectl (e.g. `kubectl apply --dry-run=client -f recycler.yaml`) before pointing KCM at it."],"exampleFix":"// before: points at a non-compliant pod template\nconfig.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathNFS = \"/etc/k8s/recycler.yaml\"\n// after: use the built-in default recycler template\nconfig.PersistentVolumeRecyclerConfiguration.PodTemplateFilePathNFS = \"\"","handlingStrategy":"validation","validationCode":"// Validate a recycler pod template file before pointing KCM at it\npod, err := volumeutil.LoadPodFromFile(path)\nif err != nil {\n    return err\n}\nif err := volume.ValidateRecyclerPodTemplate(pod); err != nil {\n    return fmt.Errorf(\"pod specification (%v): %v\", path, err)\n}","typeGuard":null,"tryCatchPattern":"if err := AttemptToLoadRecycler(path, config); err != nil {\n    logger.Error(err, \"recycler template invalid; falling back to default\")\n    config.RecyclerPodTemplate = volume.NewPersistentVolumeRecyclerPodTemplate()\n}","preventionTips":["Pre-validate recycler pod manifests with ValidateRecyclerPodTemplate in CI.","Leave PodTemplateFilePath empty to use the built-in default recycler unless you truly need customization.","Re-check recycler templates after K8s upgrades that tighten the pod contract."],"tags":["kubernetes","go","kube-controller-manager","volumes","persistent-volume","recycler","configuration","validation"],"analyzedSha":"b882c60b4023bdf09264c2d5d30a2cadebc240fb","analyzedAt":"2026-08-07T04:07:48.144Z","schemaVersion":2},"datasetVersion":"2026-08-07T07:17:06.508Z"}