Skip to content

Commit

Permalink
CLOUDP-261495: Bump CLI to Atlas Operator 2.4.0 (#3116)
Browse files Browse the repository at this point in the history
Signed-off-by: jose.vazquez <[email protected]>
  • Loading branch information
josvazg authored Jul 17, 2024
1 parent 3bfd384 commit bece889
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion docs/command/atlas-kubernetes-config-generate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Options
* - --operatorVersion
- string
- false
- Version of Atlas Kubernetes Operator to generate resources for. This value defaults to "2.3.0".
- Version of Atlas Kubernetes Operator to generate resources for. This value defaults to "2.4.0".
* - --orgId
- string
- false
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/mongodb-forks/digest v1.1.0
github.com/mongodb-labs/cobra2snooty v0.18.2
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.3.1
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.4.0
github.com/pelletier/go-toml v1.9.5
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/spf13/afero v1.11.0
Expand Down Expand Up @@ -86,7 +86,7 @@ require (
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
Expand Down Expand Up @@ -235,8 +235,8 @@ github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKk
github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/mongodb-labs/cobra2snooty v0.18.2 h1:qWpLCMWbQb5FSZ5ehiWN2URmieMJhQtQPxT0uhIK62A=
github.com/mongodb-labs/cobra2snooty v0.18.2/go.mod h1:WnzqCFmx4f72Yj9dL/ulBUqcatfURGdKFf8DLT4h7zQ=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.3.1 h1:Hv4FxwU8bLGJ9+Diq6s2KcYxTs0WQaByveG0eqvXi7s=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.3.1/go.mod h1:gZZH75cuBZY3dj3rN7FATBfe3GZb8w1/uhseZtkV8Eo=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.4.0 h1:aQ/mBeEmw+C213cHCXbN+AaSvSxMvE/s8qx6Lbyoeu8=
github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.4.0/go.mod h1:wcJTdbOoSw5A60gjmlYyzVaLzfiqhXH/5R8KzWxGcDo=
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
Expand Down
8 changes: 4 additions & 4 deletions internal/kubernetes/operator/config_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func TestExportAtlasStreamProcessing(t *testing.T) {
ce := NewConfigExporter(atlasOperatorGenericStore, nil, projectID, orgID).
WithFeatureValidator(featureValidator).
WithTargetNamespace("test").
WithTargetOperatorVersion("2.3.0")
WithTargetOperatorVersion("2.4.0")

resources, err := ce.exportAtlasStreamProcessing("my-project")
require.NoError(t, err)
Expand All @@ -308,7 +308,7 @@ func TestExportAtlasStreamProcessing(t *testing.T) {
Name: "my-project-instance-0",
Namespace: "test",
Labels: map[string]string{
"mongodb.com/atlas-resource-version": "2.3.0",
"mongodb.com/atlas-resource-version": "2.4.0",
},
},
Spec: akov2.AtlasStreamInstanceSpec{
Expand Down Expand Up @@ -348,7 +348,7 @@ func TestExportAtlasStreamProcessing(t *testing.T) {
Name: "my-project-instance-0-samplelowlinestreamlowlinesolar",
Namespace: "test",
Labels: map[string]string{
"mongodb.com/atlas-resource-version": "2.3.0",
"mongodb.com/atlas-resource-version": "2.4.0",
},
},
Spec: akov2.AtlasStreamConnectionSpec{
Expand All @@ -370,7 +370,7 @@ func TestExportAtlasStreamProcessing(t *testing.T) {
Name: "my-project-instance-0-kafka-config",
Namespace: "test",
Labels: map[string]string{
"mongodb.com/atlas-resource-version": "2.3.0",
"mongodb.com/atlas-resource-version": "2.4.0",
},
},
Spec: akov2.AtlasStreamConnectionSpec{
Expand Down
38 changes: 21 additions & 17 deletions internal/kubernetes/operator/features/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ import (
)

const (
LatestOperatorMajorVersion = "2.3.0"
maxDepth = 100
ResourceVersion = "mongodb.com/atlas-resource-version"
ResourceAtlasProject = "atlasprojects"
ResourceAtlasDeployment = "atlasdeployments"
ResourceAtlasDatabaseUser = "atlasdatabaseusers"
ResourceAtlasBackupSchedule = "atlasbackupschedules"
ResourceAtlasBackupPolicy = "atlasbackuppolicies"
ResourceAtlasTeam = "atlasteams"
ResourceAtlasDataFederation = "atlasdatafederations"
ResourceAtlasFederatedAuth = "atlasfederatedauths"
ResourceAtlasStreamInstance = "atlasstreaminstances"
ResourceAtlasStreamConnection = "atlasstreamconnections"
LatestOperatorMajorVersion = "2.4.0"
maxDepth = 100
ResourceVersion = "mongodb.com/atlas-resource-version"
ResourceAtlasProject = "atlasprojects"
ResourceAtlasDeployment = "atlasdeployments"
ResourceAtlasDatabaseUser = "atlasdatabaseusers"
ResourceAtlasBackupSchedule = "atlasbackupschedules"
ResourceAtlasBackupPolicy = "atlasbackuppolicies"
ResourceAtlasTeam = "atlasteams"
ResourceAtlasDataFederation = "atlasdatafederations"
ResourceAtlasFederatedAuth = "atlasfederatedauths"
ResourceAtlasStreamInstance = "atlasstreaminstances"
ResourceAtlasStreamConnection = "atlasstreamconnections"
ResourceAtlasBackupCompliancePolicy = "atlasbackupcompliancepolicies"
)

var (
Expand All @@ -51,17 +52,17 @@ var (
ErrDocumentHasNoSpec = errors.New("document contains no Spec")

versionsToResourcesMap = map[string][]resource{
"2.1.0": {
"2.2.0": {
resource{ResourceAtlasDatabaseUser, NopPatcher()},
resource{ResourceAtlasProject, NopPatcher()},
resource{ResourceAtlasDeployment, NopPatcher()},
resource{ResourceAtlasBackupSchedule, NopPatcher()},
resource{ResourceAtlasBackupPolicy, PatcherFunc(UnknownBackupPolicyFrequencyTypesPruner)},
resource{ResourceAtlasBackupPolicy, NopPatcher()},
resource{ResourceAtlasTeam, NopPatcher()},
resource{ResourceAtlasDataFederation, NopPatcher()},
resource{ResourceAtlasFederatedAuth, NopPatcher()},
},
"2.2.0": {
"2.3.0": {
resource{ResourceAtlasDatabaseUser, NopPatcher()},
resource{ResourceAtlasProject, NopPatcher()},
resource{ResourceAtlasDeployment, NopPatcher()},
Expand All @@ -70,8 +71,10 @@ var (
resource{ResourceAtlasTeam, NopPatcher()},
resource{ResourceAtlasDataFederation, NopPatcher()},
resource{ResourceAtlasFederatedAuth, NopPatcher()},
resource{ResourceAtlasStreamInstance, NopPatcher()},
resource{ResourceAtlasStreamConnection, NopPatcher()},
},
"2.3.0": {
"2.4.0": {
resource{ResourceAtlasDatabaseUser, NopPatcher()},
resource{ResourceAtlasProject, NopPatcher()},
resource{ResourceAtlasDeployment, NopPatcher()},
Expand All @@ -82,6 +85,7 @@ var (
resource{ResourceAtlasFederatedAuth, NopPatcher()},
resource{ResourceAtlasStreamInstance, NopPatcher()},
resource{ResourceAtlasStreamConnection, NopPatcher()},
resource{ResourceAtlasBackupCompliancePolicy, NopPatcher()},
},
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
const (
testNamespace = "test"
testProjectName = "my-project"
testOperatorVersion = "2.3.0"
testOperatorVersion = "2.4.0"
testInstanceName = "instance-0"
testCertificate = "-----BEGIN CERTIFICATE-----\nMIIEITCCAwmgAwIBAgIUTLX+HHPxjMxw1pOXEu/+m+aXrgIwDQYJKoZIhvcNAQEL\nBQAwgZ8xCzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgN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PVWFvOdPoiJnmJjUQ5W3FUVZWOgx3rFlKO/5HOi5wRvBDyuZsTjIEJP5MOl\n3lBs17FOVqM3iT785oabOEj/8LhkvdG9brobG8oAttUSPChiYbEtH83WqgeHnCWI\nreLAKIvG8bFVaokdInEgoRt5uque70g0tqAje9MXqCodB96Lo1tk8yyvX4jWI2Pb\npe7aAzw79hIH3tyw+FHjZLgHAq77E14xBxMxvamSnsqGhvCkb7pRHD5+l4tg2k/N\nYJZC5C0=\n-----END CERTIFICATE-----\n"
)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/atlas/kubernetes_config_generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ func TestProjectWithStreamsProcessing(t *testing.T) {
),
Namespace: targetNamespace,
Labels: map[string]string{
"mongodb.com/atlas-resource-version": "2.3.0",
"mongodb.com/atlas-resource-version": "2.4.0",
},
},
Spec: akov2.AtlasStreamInstanceSpec{
Expand Down Expand Up @@ -885,7 +885,7 @@ func TestProjectWithStreamsProcessing(t *testing.T) {
),
Namespace: targetNamespace,
Labels: map[string]string{
"mongodb.com/atlas-resource-version": "2.3.0",
"mongodb.com/atlas-resource-version": "2.4.0",
},
},
Spec: akov2.AtlasStreamConnectionSpec{
Expand Down

0 comments on commit bece889

Please sign in to comment.