cilium/cilium · error

invalid podIfName in request %s for claim %s: %w

Error message

invalid podIfName in request %s for claim %s: %w

What it means

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.

Source

Thrown at pkg/networkdriver/dra.go:409

	existingStatusDevice := make(map[string]struct{})
	for _, ds := range claim.Status.Devices {
		if ds.Driver == driver.config.DriverName {
			existingStatusDevice[ds.Device] = struct{}{}
		}
	}

	return claimPrepState{
		existingByDevice:     existingByDevice,
		existingStatusDevice: existingStatusDevice,
	}
}

// validatePodIfNames checks that every podIfName in the claim's device configs
// is a valid Linux interface name before any destructive work begins.
func validatePodIfNames(claim *resourceapi.ResourceClaim, deviceClaimConfigs map[string]types.DeviceConfig) error {
	for request, cfg := range deviceClaimConfigs {
		if err := types.ValidateInterfaceName(cfg.PodIfName); err != nil {
			return fmt.Errorf("invalid podIfName in request %s for claim %s: %w",
				request, path.Join(claim.Namespace, claim.Name), err)
		}
	}
	return nil
}

// rollbackDevice undoes the setup of a single device: it frees the device and
// releases any pool-allocated addresses. Failures are logged rather than
// returned, and the call is a safe no-op when there is nothing to undo — a
// zero-value allocation (no device set up) is ignored, and releaseAddrs already
// no-ops for configs without a pool. This lets every error path roll back
// unconditionally without first checking whether work was actually done.
func (driver *Driver) rollbackDevice(a allocation) {
	if a.Device == nil {
		// Nothing was set up for this allocation; nothing to roll back.
		return
	}
	if err := a.Device.Free(a.Config); err != nil {

View on GitHub (pinned to ac7b90affa)

Solutions

  1. Read the wrapped cause from types.ValidateInterfaceName (length vs charset) and correct podIfName in the claim's opaque device config.
  2. Keep podIfName ≤ 15 characters and limited to typical Linux ifname characters (no slashes/whitespace).
  3. If podIfName is templated, validate the rendered value at deploy time (e.g. with the same ValidateInterfaceName rule).
  4. Use the driver's documented default interface naming when no explicit name is needed (omit podIfName).

Example fix

// before
{"podIfName":"pod-net-interface-0"} // 19 chars, exceeds IFNAMSIZ-1
// after
{"podIfName":"podnet0"}
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate podIfName like the driver does (Linux IFNAMSIZ = 16 incl. NUL):
func validIfName(s string) bool {
  return len(s) > 0 && len(s) <= 15 &&
    !strings.ContainsAny(s, "/ \t\n") && s != "." && s != ".."
}

Try / catch

if err := plugin.Prepare(...); err != nil && strings.Contains(err.Error(), "invalid podIfName") {
  // fix claim params and resubmit; safe — nothing was set up
}

Prevention

When it happens

Trigger: 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 '-'.

Common situations: 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.

Related errors


AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31). Data as JSON: /api/errors/6e3426491b61b9a3. Report an issue: GitHub.