Skip to content

Agent stays Pending forever if its first enrollment request fails to publish #507

Description

@retr0h

Reviewer finding, not yet independently confirmed.

handlePKIEnrollment (internal/agent/enrollment.go:46-99) publishes the enrollment request once and only logs a warning on failure before entering Pending. The controller never receives the request, and Start() only starts consumers when the agent is not Pending (internal/agent/server.go:113), so the agent never processes jobs until it is restarted.

Fix: retry the enrollment request periodically while the agent is Pending, for example on the heartbeat ticker.


Found in the September 2026 codebase review. Tracked in the review tracking issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingkind/go

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions