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

CLOUDP-291622: Add delete command for Atlas Stream Processing PrivateLinks #3671

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

jasonrydberg
Copy link
Collaborator

@jasonrydberg jasonrydberg commented Feb 18, 2025

Proposed changes

Add the ability for users to delete a PrivateLink endpoint that is used with Stream Processing.

Jira ticket: CLOUDP-291622

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
  • I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
  • I have updated test/README.md (if an e2e test has been added)
  • I have run make fmt and formatted my code

Further comments

Example output

➜  mongodb-atlas-cli git:(CLOUDP-291622) ✗ bin/atlas --profile dev streams privateLinks delete
Error: "atlas streams privateLinks delete" requires 1 argument, received 0

Usage:  atlas streams privateLinks delete <connectionID> [flags]

➜  mongodb-atlas-cli git:(CLOUDP-291622) ✗ bin/atlas --profile dev streams privateLinks delete 67b51049b5957dd0e8aaf9d0
? Are you sure you want to delete: 67b51049b5957dd0e8aaf9d0 Yes
Atlas Stream Processing PrivateLink endpoint '67b51049b5957dd0e8aaf9d0' deleted.

➜  mongodb-atlas-cli git:(CLOUDP-291622) ✗ bin/atlas --profile dev streams privateLinks delete 67b51049b5957dd0e8aaf9d0 --force
Atlas Stream Processing PrivateLink endpoint '67b51049b5957dd0e8aaf9d0' deleted.

➜  mongodb-atlas-cli git:(CLOUDP-291622) ✗ bin/atlas --profile dev streams privateLinks delete 67b51049b5957dd0e8aaf9d0
? Are you sure you want to delete: 67b51049b5957dd0e8aaf9d0 No
Atlas Stream Processing PrivateLink endpoint not deleted

@jasonrydberg jasonrydberg marked this pull request as ready for review February 19, 2025 16:08
@jasonrydberg jasonrydberg requested review from a team as code owners February 19, 2025 16:08
Copy link
Collaborator

@tcannon91 tcannon91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just a question, everything else looks good!

"github.com/stretchr/testify/require"
)

func TestDeleteOpts_Run(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to have tests asserting the success and failure templates? I can see an argument that is validating the cli delete helper so feel free to tell me "no" 🙃

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found a clean way to check this in unit tests and we aren't verifying the output for other delete tests.

I added an additional test for the non-confirm delete case and we have an e2e test that verifies output for a successful delete.

Copy link
Collaborator

@tcannon91 tcannon91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Copy link

@jvincent-mongodb jvincent-mongodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasonrydberg jasonrydberg merged commit 67979f8 into mongodb:master Feb 20, 2025
21 of 22 checks passed
@jasonrydberg jasonrydberg deleted the CLOUDP-291622 branch February 20, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants