Skip to content
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

Clean up message when audit/uninstall returns 401 #6735

Merged

Conversation

michel-laterman
Copy link
Contributor

What does this PR do?

Clean up cli output when elastic-agent uninstall runs when the agent has previously been unenrolled.

Why is it important?

Current output indicates an error state, this can lead to confusion.
New output will indicate that the notification is dropped.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

N/A

How to test this PR locally

Unenroll an agent in fleet, then run the uninstall command.

Related issues

@michel-laterman michel-laterman added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches labels Feb 6, 2025
@michel-laterman michel-laterman requested a review from a team as a code owner February 6, 2025 18:46
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@michel-laterman michel-laterman enabled auto-merge (squash) February 7, 2025 17:56
@michel-laterman michel-laterman merged commit c82d568 into elastic:main Feb 7, 2025
14 checks passed
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

# Conflicts:
#	internal/pkg/agent/install/uninstall_test.go
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

# Conflicts:
#	internal/pkg/agent/install/uninstall_test.go
mergify bot pushed a commit that referenced this pull request Feb 7, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)
@michel-laterman michel-laterman deleted the improve-uninstall-notify-message branch February 7, 2025 22:57
michel-laterman added a commit that referenced this pull request Feb 8, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

Co-authored-by: Michel Laterman <[email protected]>
michel-laterman added a commit that referenced this pull request Feb 8, 2025
…401 (#6768)

* Clean up message when audit/uninstall returns 401 (#6735)

* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

# Conflicts:
#	internal/pkg/agent/install/uninstall_test.go

* Fix merge conflict

---------

Co-authored-by: Michel Laterman <[email protected]>
Co-authored-by: michel-laterman <[email protected]>
michel-laterman added a commit that referenced this pull request Feb 8, 2025
…401 (#6767)

* Clean up message when audit/uninstall returns 401 (#6735)

* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

# Conflicts:
#	internal/pkg/agent/install/uninstall_test.go

* Fix merge conflict

---------

Co-authored-by: Michel Laterman <[email protected]>
Co-authored-by: michel-laterman <[email protected]>
michel-laterman added a commit that referenced this pull request Feb 18, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

Co-authored-by: Michel Laterman <[email protected]>
michel-laterman added a commit that referenced this pull request Feb 18, 2025
* Clean up message when audit/uninstall returns 401

* Update internal/pkg/agent/install/uninstall.go

Co-authored-by: Craig MacKenzie <[email protected]>

---------

Co-authored-by: Craig MacKenzie <[email protected]>
(cherry picked from commit c82d568)

Co-authored-by: Michel Laterman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid api key error is observed in CLI on running uninstall command for unenrolled agent.
3 participants