-
Notifications
You must be signed in to change notification settings - Fork 581
feat: create new jujud controller binary #22460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
iyiguncevik
merged 4 commits into
juju:feature/standalone-controller
from
iyiguncevik:juju-9706-step-2
May 22, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cb0afa9
feat: copy cmd/jujuagentd to cmd/jujud with updated import paths
iyiguncevik 049fd81
feat: add controller binary constant and update identity in cmd/jujud
iyiguncevik 4b99a35
feat: add jujud build target to Makefile
iyiguncevik 6336cf8
feat: add jujud external references
iyiguncevik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| // Copyright 2012, 2013 Canonical Ltd. | ||
| // Licensed under the AGPLv3, see LICENCE file for details. | ||
|
|
||
| package agent | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/juju/tc" | ||
|
|
||
| "github.com/juju/juju/agent" | ||
| "github.com/juju/juju/cmd/cmd" | ||
| "github.com/juju/juju/cmd/cmd/cmdtesting" | ||
| "github.com/juju/juju/cmd/internal/agent/agentconf" | ||
| corelogger "github.com/juju/juju/core/logger" | ||
| internallogger "github.com/juju/juju/internal/logger" | ||
| "github.com/juju/juju/internal/testhelpers" | ||
| ) | ||
|
|
||
| type acCreator func() (cmd.Command, agentconf.AgentConf) | ||
|
|
||
| // CheckAgentCommand is a utility function for verifying that common agent | ||
| // options are handled by a Command; it returns an instance of that | ||
| // command pre-parsed, with any mandatory flags added. | ||
| func CheckAgentCommand(c *tc.C, dataDir string, create acCreator, args []string) cmd.Command { | ||
| _, conf := create() | ||
| c.Assert(conf.DataDir(), tc.Equals, dataDir) | ||
| badArgs := append(args, "--data-dir", "") | ||
| com, _ := create() | ||
| err := cmdtesting.InitCommand(com, badArgs) | ||
| c.Assert(err, tc.ErrorMatches, "--data-dir option must be set") | ||
| return com | ||
| } | ||
|
|
||
| // ParseAgentCommand is a utility function that inserts the always-required args | ||
| // before parsing an agent command and returning the result. | ||
| func ParseAgentCommand(ac cmd.Command, args []string) error { | ||
| common := []string{ | ||
| "--data-dir", "jd", | ||
| } | ||
| return cmdtesting.InitCommand(ac, append(common, args...)) | ||
| } | ||
|
|
||
| type agentLoggingSuite struct { | ||
| testhelpers.IsolationSuite | ||
| } | ||
|
|
||
| func TestAgentLoggingSuite(t *testing.T) { | ||
| tc.Run(t, &agentLoggingSuite{}) | ||
| } | ||
|
|
||
| func (*agentLoggingSuite) TestNoLoggingConfig(c *tc.C) { | ||
| f := &fakeLoggingConfig{} | ||
| context := internallogger.LoggerContext(corelogger.WARNING) | ||
| initial := context.Config().String() | ||
|
|
||
| agentconf.SetupAgentLogging(context, f) | ||
|
|
||
| c.Assert(context.Config().String(), tc.Equals, initial) | ||
| } | ||
|
|
||
| func (*agentLoggingSuite) TestLoggingOverride(c *tc.C) { | ||
| f := &fakeLoggingConfig{ | ||
| loggingOverride: "test=INFO", | ||
| } | ||
| context := internallogger.LoggerContext(corelogger.WARNING) | ||
|
|
||
| agentconf.SetupAgentLogging(context, f) | ||
|
|
||
| c.Assert(context.Config().String(), tc.Equals, "<root>=WARNING;test=INFO") | ||
| } | ||
|
|
||
| func (*agentLoggingSuite) TestLoggingConfig(c *tc.C) { | ||
| f := &fakeLoggingConfig{ | ||
| loggingConfig: "test=INFO", | ||
| } | ||
| context := internallogger.LoggerContext(corelogger.WARNING) | ||
|
|
||
| agentconf.SetupAgentLogging(context, f) | ||
|
|
||
| c.Assert(context.Config().String(), tc.Equals, "<root>=WARNING;test=INFO") | ||
| } | ||
|
|
||
| type fakeLoggingConfig struct { | ||
| agent.Config | ||
|
|
||
| loggingConfig string | ||
| loggingOverride string | ||
| } | ||
|
|
||
| func (f *fakeLoggingConfig) LoggingConfig() string { | ||
| return f.loggingConfig | ||
| } | ||
|
|
||
| func (f *fakeLoggingConfig) Value(key string) string { | ||
| if key == agent.LoggingOverride { | ||
| return f.loggingOverride | ||
| } | ||
| return "" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll know this works when this becomes the following: