feat: create new jujud controller binary#22460
Merged
iyiguncevik merged 4 commits intoMay 22, 2026
Merged
Conversation
Copy cmd/jujuagentd/ to cmd/jujud/ as a separate Go package (Phase 1) and update all Go import paths from cmd/jujuagentd to cmd/jujud (Phase 2). The cmd/jujuagentd/ package is unchanged. The new cmd/jujud/ package has all internal import paths, mockgen directives, and generated mock source comments updated to reference cmd/jujud.
Add names.JujuController = "jujud" constant and rename names.Jujud to names.JujuAgentd, names.JujudVersions to names.JujuVersions for clarity. In the new cmd/jujud/ package: - Update SuperCommand Name from "jujuagentd" to "jujud" - Update dispatch case from jujunames.Jujud to jujunames.JujuController - Update tool path references from jujunames.Jujud to jujunames.JujuController Across the codebase, update all references from names.Jujud to names.JujuAgentd and names.JujudVersions to names.JujuVersions to reflect the constant rename.
Add jujud controller binary as a separate Makefile build target:
- Add jujud to BUILD_CGO_AGENT_TARGETS alongside jujuagentd
- Add jujud to INSTALL_TARGETS (linux only)
- Add .PHONY jujud install target with CGO/dqlite/libsqlite3 tags
- Add platform-specific ${BUILD_DIR}/%/bin/jujud build target
The jujud target is for local builds only and is not added to
simplestreams packaging.
Add cmd/jujud package to external reference files: - cmd/package_test.go: add jujud to ignoredPackages - scripts/engine-dag/main.go: add cmd/jujud/agent/machine and cmd/jujud/agent/model imports with --agent flag selector - cmd/containeragent/unit/package_test.go: add cmd/jujud/agent/* entries alongside existing cmd/jujuagentd/agent/* entries
SimonRichardson
approved these changes
May 22, 2026
Member
SimonRichardson
left a comment
There was a problem hiding this comment.
Follow ups:
- Do we want two versions for jujud and jujuagentd? I don't think we do want to do that, but we should explore this.
- Versions of the agent and the controller will mismatch during an upgrade or via misconfigured setups, which I know we're not trying to solve yet, but we should keep a note. We should prevent an jujuagentd being able to be to talk to jujud that is lower version than itself. That sort of misconfiguration might be dangerous.
| @@ -316,6 +318,13 @@ jujuagentd: musl-install-if-missing dqlite-install-if-missing | |||
| ## jujuagentd: Install jujuagentd without updating dependencies | |||
| ${run_cgo_install} | |||
Member
There was a problem hiding this comment.
We'll know this works when this becomes the following:
Suggested change
| ${run_cgo_install} | |
| ${run_go_install} |
ba9271b
into
juju:feature/standalone-controller
23 of 26 checks passed
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.
Creates a separate
jujudcontroller binary by cloningcmd/jujuagentd/tocmd/jujud/as an independent Go package. This binary will become the controller application, packaged as thejuju-controllersnap.Changes
New package:
cmd/jujud/cmd/jujuagentd/with all import paths updated tocmd/jujudjujud(via SuperCommandNamefield)juju.cmd.jujudnames.JujuControllernames.JujuControllerjujuagentd(steps 3 & 4 will diverge them)juju/names/names.goJujuController = "jujud"constantJujud→JujuAgentdandJujudVersions→JujuVersionsfor clarityMakefile
jujudtoBUILD_CGO_AGENT_TARGETS,INSTALL_TARGETS(linux only).PHONY jujudinstall target and${BUILD_DIR}/%/bin/jujudbuild targetjujudis not added to simplestreams packaging (distributed via snap only)External references
cmd/package_test.go: addedjujudto ignored packagesscripts/engine-dag/main.go: addedcmd/jujud/agent/{machine,model}imports with--agentflagcmd/containeragent/unit/package_test.go: addedcmd/jujud/agent/*entriesOut of scope
Checklist
doc.go added or updated in changed packagesQA steps
Verify bootstrap is still working fine:
Documentation changes
Links
Jira card: JUJU-9706