Skip to content

Commit 8651b0c

Browse files
authored
CLOUDP-234527 Remove MongoCLI 4th followup (#2725)
1 parent f402070 commit 8651b0c

File tree

6 files changed

+32
-123
lines changed

6 files changed

+32
-123
lines changed

internal/cli/atlas/clusters/clusters.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,6 @@ import (
2828
atlas "go.mongodb.org/atlas/mongodbatlas"
2929
)
3030

31-
// MongoCLIBuilder is to split "mongocli atlas clusters" and "atlas clusters".
32-
func MongoCLIBuilder() *cobra.Command {
33-
const use = "clusters"
34-
cmd := &cobra.Command{
35-
Use: use,
36-
Aliases: cli.GenerateAliases(use),
37-
SuggestFor: []string{"replicasets"},
38-
Short: "Manage clusters for your project.",
39-
Long: `The clusters command provides access to your cluster configurations. You can create, edit, and delete clusters.`,
40-
}
41-
42-
cmd.AddCommand(
43-
ListBuilder(),
44-
DescribeBuilder(),
45-
CreateBuilder(),
46-
WatchBuilder(),
47-
UpdateBuilder(),
48-
PauseBuilder(),
49-
StartBuilder(),
50-
DeleteBuilder(),
51-
LoadSampleDataBuilder(false),
52-
indexes.Builder(),
53-
search.Builder(),
54-
onlinearchive.Builder(),
55-
connectionstring.Builder(),
56-
)
57-
58-
return cmd
59-
}
60-
6131
func Builder() *cobra.Command {
6232
const use = "clusters"
6333
cmd := &cobra.Command{

internal/cli/atlas/clusters/clusters_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ func TestBuilder(t *testing.T) {
3434
)
3535
}
3636

37-
func TestMongoCLIBuilder(t *testing.T) {
38-
test.CmdValidator(
39-
t,
40-
MongoCLIBuilder(),
41-
13,
42-
[]string{},
43-
)
44-
}
45-
4637
func TestRemoveReadOnlyAttributes(t *testing.T) {
4738
var (
4839
id = "Test"

internal/cli/atlas/logs/logs.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ import (
2020
"github.com/spf13/cobra"
2121
)
2222

23-
// MongoCLIBuilder is to split "mongocli atlas logs" and "atlas logs".
24-
func MongoCLIBuilder() *cobra.Command {
25-
const use = "logs"
26-
cmd := &cobra.Command{
27-
Use: use,
28-
Aliases: cli.GenerateAliases(use),
29-
Short: "Download host logs for your project.",
30-
}
31-
cmd.AddCommand(DownloadBuilder())
32-
33-
return cmd
34-
}
35-
3623
// Builder is the up-to-date builder used by atlascli.
3724
func Builder() *cobra.Command {
3825
const use = "logs"

internal/cli/atlas/logs/logs_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,3 @@ func TestBuilder(t *testing.T) {
3030
[]string{},
3131
)
3232
}
33-
34-
func TestMongoCLIBuilder(t *testing.T) {
35-
test.CmdValidator(
36-
t,
37-
MongoCLIBuilder(),
38-
1,
39-
[]string{},
40-
)
41-
}

internal/config/profile.go

Lines changed: 32 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -38,43 +38,38 @@ import (
3838
//go:generate mockgen -destination=../mocks/mock_profile.go -package=mocks github.com/mongodb/mongodb-atlas-cli/atlascli/internal/config SetSaver
3939

4040
const (
41-
MongoCLIEnvPrefix = "MCLI" // MongoCLIEnvPrefix prefix for MongoCLI ENV variables
42-
AtlasCLIEnvPrefix = "MONGODB_ATLAS" // AtlasCLIEnvPrefix prefix for AtlasCLI ENV variables
43-
DefaultProfile = "default" // DefaultProfile default
44-
CloudService = "cloud" // CloudService setting when using Atlas API
45-
CloudGovService = "cloudgov" // CloudGovService setting when using Atlas API for Government
46-
CloudManagerService = "cloud-manager" // CloudManagerService settings when using CLoud Manager API
47-
OpsManagerService = "ops-manager" // OpsManagerService settings when using Ops Manager API
48-
JSON = "json" // JSON output format as json
49-
projectID = "project_id"
50-
orgID = "org_id"
51-
mongoShellPath = "mongosh_path"
52-
configType = "toml"
53-
service = "service"
54-
publicAPIKey = "public_api_key"
55-
privateAPIKey = "private_api_key"
56-
AccessTokenField = "access_token"
57-
RefreshTokenField = "refresh_token"
58-
ClientIDField = "client_id"
59-
OpsManagerURLField = "ops_manager_url"
60-
baseURL = "base_url"
61-
opsManagerCACertificate = "ops_manager_ca_certificate"
62-
opsManagerSkipVerify = "ops_manager_skip_verify"
63-
opsManagerVersionManifestURL = "ops_manager_version_manifest_url"
64-
output = "output"
65-
fileFlags = os.O_CREATE | os.O_TRUNC | os.O_WRONLY
66-
configPerm = 0600
67-
defaultPermissions = 0700
68-
skipUpdateCheck = "skip_update_check"
69-
TelemetryEnabledProperty = "telemetry_enabled"
70-
AtlasCLI = "atlascli"
71-
ContainerizedHostNameEnv = "MONGODB_ATLAS_IS_CONTAINERIZED"
72-
GitHubActionsHostNameEnv = "GITHUB_ACTIONS"
73-
AtlasActionHostNameEnv = "ATLAS_GITHUB_ACTION"
74-
NativeHostName = "native"
75-
DockerContainerHostName = "container"
76-
GitHubActionsHostName = "all_github_actions"
77-
AtlasActionHostName = "atlascli_github_action"
41+
MongoCLIEnvPrefix = "MCLI" // MongoCLIEnvPrefix prefix for MongoCLI ENV variables
42+
AtlasCLIEnvPrefix = "MONGODB_ATLAS" // AtlasCLIEnvPrefix prefix for AtlasCLI ENV variables
43+
DefaultProfile = "default" // DefaultProfile default
44+
CloudService = "cloud" // CloudService setting when using Atlas API
45+
CloudGovService = "cloudgov" // CloudGovService setting when using Atlas API for Government
46+
JSON = "json" // JSON output format as json
47+
projectID = "project_id"
48+
orgID = "org_id"
49+
mongoShellPath = "mongosh_path"
50+
configType = "toml"
51+
service = "service"
52+
publicAPIKey = "public_api_key"
53+
privateAPIKey = "private_api_key"
54+
AccessTokenField = "access_token"
55+
RefreshTokenField = "refresh_token"
56+
ClientIDField = "client_id"
57+
OpsManagerURLField = "ops_manager_url"
58+
baseURL = "base_url"
59+
output = "output"
60+
fileFlags = os.O_CREATE | os.O_TRUNC | os.O_WRONLY
61+
configPerm = 0600
62+
defaultPermissions = 0700
63+
skipUpdateCheck = "skip_update_check"
64+
TelemetryEnabledProperty = "telemetry_enabled"
65+
AtlasCLI = "atlascli"
66+
ContainerizedHostNameEnv = "MONGODB_ATLAS_IS_CONTAINERIZED"
67+
GitHubActionsHostNameEnv = "GITHUB_ACTIONS"
68+
AtlasActionHostNameEnv = "ATLAS_GITHUB_ACTION"
69+
NativeHostName = "native"
70+
DockerContainerHostName = "container"
71+
GitHubActionsHostName = "all_github_actions"
72+
AtlasActionHostName = "atlascli_github_action"
7873
)
7974

8075
var (
@@ -122,8 +117,6 @@ func Properties() []string {
122117
output,
123118
OpsManagerURLField,
124119
baseURL,
125-
opsManagerCACertificate,
126-
opsManagerSkipVerify,
127120
mongoShellPath,
128121
skipUpdateCheck,
129122
TelemetryEnabledProperty,
@@ -447,24 +440,6 @@ func (p *Profile) SetOpsManagerURL(v string) {
447440
p.Set(OpsManagerURLField, v)
448441
}
449442

450-
// OpsManagerCACertificate get configured ops manager CA certificate location.
451-
func OpsManagerCACertificate() string { return Default().OpsManagerCACertificate() }
452-
func (p *Profile) OpsManagerCACertificate() string {
453-
return p.GetString(opsManagerCACertificate)
454-
}
455-
456-
// OpsManagerSkipVerify get configured if transport should skip CA verification.
457-
func OpsManagerSkipVerify() string { return Default().OpsManagerSkipVerify() }
458-
func (p *Profile) OpsManagerSkipVerify() string {
459-
return p.GetString(opsManagerSkipVerify)
460-
}
461-
462-
// OpsManagerVersionManifestURL get configured ops manager version manifest base url.
463-
func OpsManagerVersionManifestURL() string { return Default().OpsManagerVersionManifestURL() }
464-
func (p *Profile) OpsManagerVersionManifestURL() string {
465-
return p.GetString(opsManagerVersionManifestURL)
466-
}
467-
468443
// ProjectID get configured project ID.
469444
func ProjectID() string { return Default().ProjectID() }
470445
func (p *Profile) ProjectID() string {
@@ -556,9 +531,6 @@ func (p *Profile) ClientID() string {
556531
func IsAccessSet() bool { return Default().IsAccessSet() }
557532
func (p *Profile) IsAccessSet() bool {
558533
isSet := p.PublicAPIKey() != "" && p.PrivateAPIKey() != ""
559-
if p.Service() == OpsManagerService {
560-
isSet = isSet && p.OpsManagerURL() != ""
561-
}
562534

563535
return isSet
564536
}

internal/config/profile_integration_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ func TestProfile_Get_FullProfile(t *testing.T) {
102102
a.Equal("some_public_key", profile.PublicAPIKey())
103103
a.Equal("some_private_key", profile.PrivateAPIKey())
104104
a.Equal("http://om_url.com/", profile.OpsManagerURL())
105-
a.Equal("/path/to/certificate", profile.OpsManagerCACertificate())
106-
a.Equal("false", profile.OpsManagerSkipVerify())
107105
}
108106

109107
func TestProfile_Get_Default(t *testing.T) {

0 commit comments

Comments
 (0)