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-202283: print warning for unsupported distros #2327

Merged
merged 11 commits into from
Oct 5, 2023
Merged

Conversation

blva
Copy link
Collaborator

@blva blva commented Oct 2, 2023

Proposed changes

Jira ticket: CLOUDP-202283

Notes:

  • Another alternative, would be to run this on PersistentPreRun on the root deployment command, however, the warning would show up even if customers decide to use interactive flow (not provide flags)

Ubuntu test

ubuntu@ip-10-128-79-112:~/atlascli$ ./bin/atlas deployments setup
? What type of deployment would you like to work with? local

[Default Settings]
Deployment Name   local305
MongoDB Version   7.0
Port              27017

? How do you want to set up your local MongoDB database? default
Local deployments are not supported on this OS, to see local deployments requirements visit https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/.
Error: podman not found in your system, check requirements at https://dochub.mongodb.org/core/atlas-cli-deploy-local-reqs

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

@blva blva marked this pull request as ready for review October 3, 2023 11:40
@blva blva requested a review from a team October 3, 2023 11:40
case "darwin":
// MacOS Intel and M1 are supported
return true
case "windows":
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this should avoid that we use sysinfo for windows machines, but there is a test failure I'm investigating

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated with a more known library

Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

internal/cli/atlas/deployments/setup.go Show resolved Hide resolved
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

Local deployment tests are failing. It seems that is printing OS not supported for rhel

 deployments_local_test.go:118:
 [2023/10/03 13:23:15.981]         	Error Trace:	/data/mci/ba99dbf9685aecc06f0fc28d64e7772e/src/github.com/mongodb/mongodb-atlas-cli/test/e2e/atlas/deployments_local_test.go:118
 [2023/10/03 13:23:15.981]         	Error:      	Not equal:
 [2023/10/03 13:23:15.981]         	            	expected: "NAME   TYPE    MDB VER   STATE\ntest   LOCAL   7.0.1     IDLE\n"
 [2023/10/03 13:23:15.981]         	            	actual  : "Local deployments are not supported on this OS, to see local deployments requirements visit https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/.\nNAME   TYPE    MDB VER   STATE\ntest   LOCAL   7.0.1     IDLE\n"
 [2023/10/03 13

https://evergreen.mongodb.com/test_log/mongodb_atlas_cli_master_e2e_required_atlas_deployments_local_e2e_patch_509511cea9def343bef1fc5ddd9a28e7254dfed7_651c134dd6d80a5c656ae92d_23_10_03_13_12_47/0?test_name=60ee52a7ef8e304493a393e2089646a8&group_id=#L8

@blva blva requested review from andreaangiolillo and a team October 3, 2023 16:02

func (opts *DeploymentOpts) LocalDeploymentPreRun(ctx context.Context) error {
if !localDeploymentSupportedByOs() {
_, _ = log.Warningln("Local deployments are not supported on this OS, to see local deployments requirements visit https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mongodb/docs-cloud-team asking for review here

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

zach-carr
zach-carr previously approved these changes Oct 4, 2023

func (opts *DeploymentOpts) LocalDeploymentPreRun(ctx context.Context) error {
if !localDeploymentSupportedByOs() {
_, _ = log.Warningln("Local deployments are not supported on this OS, to see local deployments requirements visit https://www.mongodb.com/docs/atlas/cli/stable/atlas-cli-deploy-local/.")
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

@blva blva merged commit 35e1c57 into master Oct 5, 2023
16 checks passed
@blva blva deleted the CLOUDP-202283 branch October 5, 2023 08:21
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