You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OCPBUGS-86311: fix: validate agent-config interface names match networkConfig (#10567)
* fix: validate agent-config interface names match networkConfig
openshift-install agent does not cross-validate that interface names in
hosts[].interfaces[] match the names used in hosts[].networkConfig. When
names mismatch, the pre-network-manager-config.sh script silently fails
to rename .nmconnection files at boot time, causing complete network
failure for bond/VLAN/bridge topologies with no diagnostic.
Add validateInterfaceNamesMatchNetworkConfig() to validateAgentHosts()
that ensures every interfaces[].name exists in the networkConfig
interfaces list. The error message lists valid networkConfig names to
guide users toward the correct configuration.
Only the agent-config.yaml path is affected; install-config.yaml derives
interface names from networkConfig automatically, so names always match.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: change interface name validation to warning per reviewer feedback
Addresses @zaneb's review: the interface name cross-check against
networkConfig is now a warning (logrus.Warnf) instead of a hard error,
and runs for both agent-config.yaml and nodes-config.yaml (oc adm
node-image create) paths — but never for install-config baremetal hosts
where getInstallConfigDefaults generates synthetic interface names.
This ensures the baremetal IPI fallback path (which generates a bogus
"boot" interface name) is never affected, while giving users early
visibility into potential name mismatches that could cause connectivity
failures at boot time.
Test coverage added for:
- install-config inert path (no warning fires)
- AddNodes workflow mismatch (warns) and match (no warning)
- empty interface name (skipped gracefully)
- malformed networkConfig YAML (no panic)
- bond interfaces matching and mismatching
Ref: OCPBUGS-86420
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: inline interface-name warning at call site, remove struct flag
Address reviewer feedback: instead of a hostsFromAgentConfig bool flag
checked inside the generic validation loop, call the warning directly in
Generate() at the two branches where user-authored hosts are already
known (agent-config and AddNodes paths).
The install-config fallback path (baremetal IPI with synthetic "boot"
interface name) never reaches the warning call, so no guard is needed.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: include field path in interface-name warning, restore comment
Address zaneb's Jun 9 review:
1. Restore "Hosts defined in agent-config take precedence" comment
that was inadvertently dropped in the previous commit.
2. Include the full field path (e.g. hosts[0].interfaces[1].name)
in the warning message so users can identify which host and
interface has the mismatch, matching the pattern used by
validation errors elsewhere in this file.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments