cEOS: make the RESTCONF bootstrap actually reach a running server - #17
Merged
Conversation
RESTCONF never came up. The startup-config configures `ssl profile restconf` before the Job that creates the certificate it names, so EOS marks the profile invalid at boot -- and creating the certificate afterwards does not revisit that verdict. `management api restconf` stayed at "SSL profile not in valid state", nothing listened on 6020, and the Job reported success throughout. Three fixes, each of which the lab needed on its own: - Re-apply the SSL profile after generating the certificate. Only a config change re-evaluates it, and re-entering the same `certificate` line is a no-op -- so the profile is removed and re-added. - Make the Job's checks honest. curl exits 0 on an HTTP 404, and during boot nginx answers on 443 with "Page not found" before eAPI is registered, so the old `if ! curl` reported success without reaching the device. Now --fail-with-body plus a check for `"result"`, and a second request that asks the device whether RESTCONF is enabled. - Wait for the device in the container instead of via restartPolicy. With OnFailure the whole cEOS boot had to fit inside backoffLimit restarts of a growing backoff; a slower node lost that race and the Job failed. The wait is now an explicit 600s deadline, which leaves backoffLimit for real failures. Verified on kind with two cEOS 4.36.1F nodes: both Jobs complete in ~2min with no restarts, and both devices answer HTTP 200 on RESTCONF 6020 and eAPI 443 from a cold boot. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RESTCONF never came up on a cEOS node. The startup-config configures
ssl profile restconfbefore the Job that creates the certificate it names, so EOS marks the profile invalid at boot — and creating the certificate afterwards does not revisit that verdict.management api restconfstayed at "SSL profile not in valid state", nothing listened on 6020, and the Job reported success throughout.Found while exercising netclab-xp's RESTCONF scenarios against a real lab: every
Requestfailed to connect, andss -tnlon the device showed only 443.Three fixes, each of which the lab needed on its own
Re-apply the SSL profile after generating the certificate. Only a config change re-evaluates the profile, and re-entering the same
certificate ... key ...line is a no-op — so the profile is removed and re-added. Idempotent on re-runs.Make the Job's checks honest.
curlexits 0 on an HTTP 404, and during boot nginx answers on 443 withPage not foundbefore eAPI is registered — so the oldif ! curlreported "Certificate generated successfully" without ever having reached the device. Now--fail-with-bodyplus a check for"result", and a second request that asks the device whether RESTCONF is actually enabled.Wait for the device in the container, not via
restartPolicy. WithOnFailurethe whole cEOS boot had to fit insidebackoffLimitrestarts of a growing backoff. One node made it on the 3rd restart; the other exhausted all 6 and the Job failed. The wait is now an explicit 600s deadline, which leavesbackoffLimitfor real failures.Verified
kind, two cEOS 4.36.1F nodes, cold boot, no manual intervention:
Completein ~2min with 0 restarts (previously: one JobFailed, one needed 2 restarts)RESTCONF not up yet, retrying...before succeeding — the SSL profile is re-evaluated asynchronously, so that second loop is load-bearing tooHTTP 200on RESTCONF 6020 and eAPI 443Note:
chart-install-test.ymlinstalls with the default values, whose only node is srlinux — so this cEOS path is not covered by CI.Chart version bumped to 0.5.10.
🤖 Generated with Claude Code