Repository navigation
Fix CLI help grammar and the privileged-switch cancellation message - #17402
Closed
Anshuman-Prakash wants to merge 1 commit into
Closed
Anshuman-Prakash wants to merge 1 commit into
Anshuman-Prakash wants to merge 1 commit into
Conversation
The privileged command reported "unprivileged switch was cancelled by the user" when its own confirmation prompt was declined, naming the opposite mode. Also fix "ask or a confirmation" in both privilege-switch long descriptions and four container help strings. Relates to elastic#14861 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
This pull request does not have a backport label. Could you fix it @Anshuman-Prakash? 🙏
|
2 of 6 tasks
This was referenced Oct 23, 2026
Merged
Merged
Merged
1 of 3 tasks
Contributor
Author
|
Superseded by #17803, which consolidates this into one PR per @bmorelli25's request. |
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.
What does this PR do?
Fixes the CLI text defects reported in #14861 — items 1 through 4 of that issue.
The one that is more than a typo (item 2) —
internal/pkg/agent/cmd/privileged.go:This sits in the
privilegedcommand's own prompt handler, so decliningelastic-agent privilegedtold the user their unprivileged switch had been cancelled — the opposite of the operation they had just aborted. The matching line inunprivileged.gois correct and is left alone.Item 1 — the same grammar error in both privilege-switch long descriptions (
privileged.go,unprivileged.go):By default this command will ask or a confirmation before making this change.By default this command will ask for confirmation before making this change.Items 3 and 4 —
internal/pkg/agent/cmd/container.gohelp text:FLEET_CA - path to certificate authority to use with communicate with Fleet Server... to certificate authority to communicate with Fleet ServerKIBANA_FLEET_CA - path to certificate authority to use with communicate with Kibana... to certificate authority to communicate with KibanaKIBANA_CA - path to certificate authority to use with communicate with Kibana... to certificate authority to communicate with KibanaELASTIC_AGENT_CERT_KEY - path to private key use for connecting to fleet-server.... path to private key to use for connecting to fleet-server.Item 5 of the issue (
an contrib→a contribin the EDOT authentication docs) is documentation, so it is in a separate docs-only PR, #17401. This PR is therefore marked "Relates to" rather than "Closes", so the issue stays open until both land.Why is it important?
Item 2 is actively misleading: a user who aborts a switch to privileged mode is told the opposite switch was cancelled, which is the sort of thing that sends someone checking whether their agent is now in the wrong mode. The rest is help text shown by
elastic-agent container --help, which is the reference operators read when wiring up the container image's environment variables.Checklist
./changelog/fragmentsusing the changelog toolA
bug-fixfragment is included for the cancellation message, since that one is user-visible behaviour rather than prose. The help-text changes on their own would not warrant a changelog entry.No test is added: the changed strings are a cobra
Longdescription and twofmt.Errorfmessages with no existing assertions against them (searching*_test.goforswitch was cancelled,ask or a confirmationanduse with communicatereturns nothing), and the prompt path requires an interactive terminal.Disruptive User Impact
None functionally — only the text of one error message and some help output changes. Anyone matching on the exact string
unprivileged switch was cancelled by the userto detect a cancelled privileged switch would need to update, but that string was wrong for that case to begin with.How to test this PR locally
gofmt -lreports no changes needed on the three edited files. I was not able to compile the packages locally: this checkout'sbeatssubmodule is not initialised, so the./beatsreplace directive makesgo build ./internal/...fail before reaching these files. The edits are string-literal only, so I have left compilation and the unit suite to CI rather than claiming a local build.Related issues
🤖 Generated with Claude Code