cilium/cilium · error
%w: %s
Error message
%w: %s
What it means
validatePools ensures no conflicting pool definitions and wraps errDuplicatedPoolName when two pools share the same PoolName. Pool names must be unique because the DRA driver registers resources per pool name. The message includes the duplicated name.
Source
Thrown at pkg/networkdriver/config.go:33
// some filter fields can be shared among devices (ex: driver, vendor, device id, pf name), but others
// can't (ex: ifname, pciaddr).
func validateFilters(this v2alpha1.CiliumNetworkDriverDevicePoolConfig, others ...v2alpha1.CiliumNetworkDriverDevicePoolConfig) error {
for _, ifname := range this.Filter.IfNames {
for _, otherPool := range others {
if slices.Contains(otherPool.Filter.IfNames, ifname) {
return fmt.Errorf("%w: %s on pools %s and %s", errIfNameInMultiplePools, ifname, this.PoolName, otherPool.PoolName)
}
}
}
return nil
}
// validatePools ensures that there are not any conflicting pool definitions.
func validatePools(this v2alpha1.CiliumNetworkDriverDevicePoolConfig, others ...v2alpha1.CiliumNetworkDriverDevicePoolConfig) error {
for _, p := range others {
if this.PoolName == p.PoolName {
return fmt.Errorf("%w: %s", errDuplicatedPoolName, this.PoolName)
}
if err := validateFilters(this, others...); err != nil {
return err
}
}
return nil
}
// validateConfig ensures a configuration is sane.
func validateConfig(c *v2alpha1.CiliumNetworkDriverNodeConfigSpec) error {
if c == nil {
// empty config is valid
return nil
}
// we dont allow pool definitions that allow matchingView on GitHub (pinned to ac7b90affa)
Solutions
- Rename one of the pools so every poolName is unique in the config
- Fix config templating/generation to guarantee unique names
- Run validateConfig on the config before applying it to catch duplicates early
Example fix
// before
pools:
- name: sriov-pool
filter: {pciAddrs: ["0000:01:00.0"]}
- name: sriov-pool
filter: {pciAddrs: ["0000:01:00.1"]}
// after
pools:
- name: sriov-pool-0
filter: {pciAddrs: ["0000:01:00.0"]}
- name: sriov-pool-1
filter: {pciAddrs: ["0000:01:00.1"]} Defensive patterns
Strategy: validation
Validate before calling
func uniquePoolNames(pools []v2alpha1.CiliumNetworkDriverDevicePoolConfig) error {
seen := map[string]bool{}
for _, p := range pools {
if seen[p.PoolName] {
return fmt.Errorf("duplicate pool name %s", p.PoolName)
}
seen[p.PoolName] = true
}
return nil
} Try / catch
if err := validateConfig(cfg); err != nil {
if errors.Is(err, errDuplicatedPoolName) {
return fmt.Errorf("rename one of the duplicated pools: %w", err)
}
return err
} Prevention
- Enforce unique pool names at config-generation time
- Lint YAML configs for duplicate keys/anchors before apply
- Add a unit test asserting validateConfig rejects duplicates
When it happens
Trigger: The CiliumNetworkDriver config contains two device pool entries with identical poolName; validatePools compares each pool against the others during validateConfig.
Common situations: Copy-pasted pool blocks without renaming; YAML anchors/merge producing duplicate names; automated config generation emitting the same name twice.
Related errors
- %w: %s on pools %s and %s
- max port value, %d, is less than or equal to min port value,
- cluster is unset
- namespace is unset
- name is unset
AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31).
Data as JSON: /api/errors/a07aa845348a2c56.
Report an issue: GitHub.