Skip to content

Commit b464100

Browse files
authored
remove tools configuration (#214)
1 parent 7900ab7 commit b464100

File tree

3 files changed

+11
-38
lines changed

3 files changed

+11
-38
lines changed

pkg/automationconfig/automation_config.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ const (
1414
)
1515

1616
type AutomationConfig struct {
17-
Version int `json:"version"`
18-
Processes []Process `json:"processes"`
19-
ReplicaSets []ReplicaSet `json:"replicaSets"`
20-
Auth Auth `json:"auth"`
21-
TLS TLS `json:"tls"`
22-
Versions []MongoDbVersionConfig `json:"mongoDbVersions"`
23-
ToolsVersion ToolsVersion `json:"mongoDbToolsVersion"`
24-
Options Options `json:"options"`
17+
Version int `json:"version"`
18+
Processes []Process `json:"processes"`
19+
ReplicaSets []ReplicaSet `json:"replicaSets"`
20+
Auth Auth `json:"auth"`
21+
TLS TLS `json:"tls"`
22+
Versions []MongoDbVersionConfig `json:"mongoDbVersions"`
23+
Options Options `json:"options"`
2524
}
2625

2726
type Process struct {

pkg/automationconfig/automation_config_builder.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ type Builder struct {
3737
previousAC AutomationConfig
3838
// MongoDB installable versions
3939
versions []MongoDbVersionConfig
40-
toolsVersion ToolsVersion
4140
modifications []Modification
4241
}
4342

@@ -85,11 +84,6 @@ func (b *Builder) SetFCV(fcv string) *Builder {
8584
return b
8685
}
8786

88-
func (b *Builder) SetToolsVersion(version ToolsVersion) *Builder {
89-
b.toolsVersion = version
90-
return b
91-
}
92-
9387
func (b *Builder) AddVersion(version MongoDbVersionConfig) *Builder {
9488
for idx := range version.Builds {
9589
if version.Builds[idx].Modules == nil {
@@ -153,10 +147,9 @@ func (b *Builder) Build() (AutomationConfig, error) {
153147
ProtocolVersion: "1",
154148
},
155149
},
156-
Versions: b.versions,
157-
ToolsVersion: b.toolsVersion,
158-
Options: Options{DownloadBase: "/var/lib/mongodb-mms-automation"},
159-
Auth: auth,
150+
Versions: b.versions,
151+
Options: Options{DownloadBase: "/var/lib/mongodb-mms-automation"},
152+
Auth: auth,
160153
TLS: TLS{
161154
ClientCertificateMode: ClientCertificateModeOptional,
162155
},

pkg/controller/mongodb/replica_set_controller.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313

1414
"github.com/mongodb/mongodb-kubernetes-operator/pkg/util/scale"
1515

16-
"github.com/mongodb/mongodb-kubernetes-operator/pkg/util/envvar"
1716
"github.com/mongodb/mongodb-kubernetes-operator/pkg/util/status"
1817

1918
"github.com/pkg/errors"
@@ -65,7 +64,6 @@ const (
6564
agentHealthStatusFilePathEnv = "AGENT_STATUS_FILEPATH"
6665
mongodbImageEnv = "MONGODB_IMAGE"
6766
mongodbRepoUrl = "MONGODB_REPO_URL"
68-
mongodbToolsVersionEnv = "MONGODB_TOOLS_VERSION"
6967
headlessAgentEnv = "HEADLESS_AGENT"
7068
podNamespaceEnv = "POD_NAMESPACE"
7169
automationConfigEnv = "AUTOMATION_CONFIG_MAP"
@@ -476,9 +474,7 @@ func buildAutomationConfig(mdb mdbv1.MongoDB, mdbVersionConfig automationconfig.
476474
SetFCV(mdb.GetFCV()).
477475
AddVersion(mdbVersionConfig).
478476
AddModifications(getMongodConfigModification(mdb)).
479-
AddModifications(modifications...).
480-
SetToolsVersion(dummyToolsVersionConfig())
481-
477+
AddModifications(modifications...)
482478
newAc, err := builder.Build()
483479
if err != nil {
484480
return automationconfig.AutomationConfig{}, err
@@ -487,21 +483,6 @@ func buildAutomationConfig(mdb mdbv1.MongoDB, mdbVersionConfig automationconfig.
487483
return newAc, nil
488484
}
489485

490-
// dummyToolsVersionConfig generates a dummy config for the tools settings in the automation config.
491-
// The agent will not uses any of these values but requires them to be set.
492-
// TODO: Remove this once the agent doesn't require any config: https://jira.mongodb.org/browse/CLOUDP-66024.
493-
func dummyToolsVersionConfig() automationconfig.ToolsVersion {
494-
return automationconfig.ToolsVersion{
495-
Version: envvar.GetEnvOrDefault(mongodbToolsVersionEnv, "100.1.0"),
496-
URLs: map[string]map[string]string{
497-
// The OS must be correctly set. Our Docker image uses Ubuntu 16.04.
498-
"linux": {
499-
"ubuntu1604": "https://dummy",
500-
},
501-
},
502-
}
503-
}
504-
505486
func readVersionManifestFromDisk() (automationconfig.VersionManifest, error) {
506487
versionManifestBytes, err := ioutil.ReadFile(versionManifestFilePath)
507488
if err != nil {

0 commit comments

Comments
 (0)