{"record":{"id":"6e3426491b61b9a3","repo":"cilium/cilium","slug":"invalid-podifname-in-request-s-for-claim-s-w","errorCode":null,"errorMessage":"invalid podIfName in request %s for claim %s: %w","messagePattern":"invalid podIfName in request (.+?) for claim (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/networkdriver/dra.go","lineNumber":409,"sourceCode":"\texistingStatusDevice := make(map[string]struct{})\n\tfor _, ds := range claim.Status.Devices {\n\t\tif ds.Driver == driver.config.DriverName {\n\t\t\texistingStatusDevice[ds.Device] = struct{}{}\n\t\t}\n\t}\n\n\treturn claimPrepState{\n\t\texistingByDevice:     existingByDevice,\n\t\texistingStatusDevice: existingStatusDevice,\n\t}\n}\n\n// validatePodIfNames checks that every podIfName in the claim's device configs\n// is a valid Linux interface name before any destructive work begins.\nfunc validatePodIfNames(claim *resourceapi.ResourceClaim, deviceClaimConfigs map[string]types.DeviceConfig) error {\n\tfor request, cfg := range deviceClaimConfigs {\n\t\tif err := types.ValidateInterfaceName(cfg.PodIfName); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid podIfName in request %s for claim %s: %w\",\n\t\t\t\trequest, path.Join(claim.Namespace, claim.Name), err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// rollbackDevice undoes the setup of a single device: it frees the device and\n// releases any pool-allocated addresses. Failures are logged rather than\n// returned, and the call is a safe no-op when there is nothing to undo — a\n// zero-value allocation (no device set up) is ignored, and releaseAddrs already\n// no-ops for configs without a pool. This lets every error path roll back\n// unconditionally without first checking whether work was actually done.\nfunc (driver *Driver) rollbackDevice(a allocation) {\n\tif a.Device == nil {\n\t\t// Nothing was set up for this allocation; nothing to roll back.\n\t\treturn\n\t}\n\tif err := a.Device.Free(a.Config); err != nil {","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/networkdriver/dra.go#L391-L427","documentation":"validatePodIfNames runs before any destructive setup and verifies that the podIfName in every per-request DeviceConfig is a valid Linux interface name (via types.ValidateInterfaceName). An invalid name (too long, empty, illegal characters, reserved forms) aborts preparation early so no device is left half-configured.","triggerScenarios":"A claim's opaque device config carries podIfName that fails types.ValidateInterfaceName — e.g. length > 15 (IFNAMSIZ-1), contains '/' or whitespace, is empty, or equals an invalid value like \".\" or starts with '-'.","commonSituations":"Typo or overly descriptive podIfName in the claim parameters (e.g. \"cilium-net-very-long-name\"); templating bug injecting an empty podIfName; config copied from a non-Linux example.","solutions":["Read the wrapped cause from types.ValidateInterfaceName (length vs charset) and correct podIfName in the claim's opaque device config.","Keep podIfName ≤ 15 characters and limited to typical Linux ifname characters (no slashes/whitespace).","If podIfName is templated, validate the rendered value at deploy time (e.g. with the same ValidateInterfaceName rule).","Use the driver's documented default interface naming when no explicit name is needed (omit podIfName)."],"exampleFix":"// before\n{\"podIfName\":\"pod-net-interface-0\"} // 19 chars, exceeds IFNAMSIZ-1\n// after\n{\"podIfName\":\"podnet0\"}","handlingStrategy":"validation","validationCode":"// Pre-validate podIfName like the driver does (Linux IFNAMSIZ = 16 incl. NUL):\nfunc validIfName(s string) bool {\n  return len(s) > 0 && len(s) <= 15 &&\n    !strings.ContainsAny(s, \"/ \\t\\n\") && s != \".\" && s != \"..\"\n}","typeGuard":null,"tryCatchPattern":"if err := plugin.Prepare(...); err != nil && strings.Contains(err.Error(), \"invalid podIfName\") {\n  // fix claim params and resubmit; safe — nothing was set up\n}","preventionTips":["Enforce podIfName ≤ 15 chars in your claim templating","Reuse the driver's types.ValidateInterfaceName in CI for generated configs","Omit podIfName when the default naming suffices"],"tags":["kubernetes","dra","validation","linux-networking","interface-name"],"backgroundTag":"invalid-interface-name","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}