From e4211d597f93c284558200121329fd4ab4a3365a Mon Sep 17 00:00:00 2001 From: "jose.vazquez" Date: Tue, 29 Oct 2024 08:30:16 +0100 Subject: [PATCH] Update AKO to 2.5.0 Signed-off-by: jose.vazquez --- go.mod | 4 +--- go.sum | 2 ++ internal/kubernetes/operator/config_exporter.go | 2 +- .../kubernetes/operator/config_exporter_test.go | 10 +++++----- internal/kubernetes/operator/features/crds.go | 15 ++++++++++++++- .../streamsprocessing/streamsprocessing_test.go | 2 +- test/e2e/atlas/kubernetes_config_generate_test.go | 4 ++-- 7 files changed, 26 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index b582c29aff..5091ffd33f 100644 --- a/go.mod +++ b/go.mod @@ -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.4.1 + github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.5.0 github.com/pelletier/go-toml v1.9.5 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/shirou/gopsutil/v4 v4.24.9 @@ -177,5 +177,3 @@ require ( sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) - -replace github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.4.1 => ../mongodb-atlas-kubernetes diff --git a/go.sum b/go.sum index c43ed96c90..2ef4cdbe66 100644 --- a/go.sum +++ b/go.sum @@ -269,6 +269,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.5.0 h1:2SzjXb9B3mVkYJfkCQXMMVjLULTNU7CXvLVKBpUe3MY= +github.com/mongodb/mongodb-atlas-kubernetes/v2 v2.5.0/go.mod h1:n4Ii1oia76D+x6Bn14KyfNxysMf6XAR6z8LfE93KHh0= 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= diff --git a/internal/kubernetes/operator/config_exporter.go b/internal/kubernetes/operator/config_exporter.go index f864ba9c62..10e02d2bba 100644 --- a/internal/kubernetes/operator/config_exporter.go +++ b/internal/kubernetes/operator/config_exporter.go @@ -29,7 +29,7 @@ import ( "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/resources" "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/kubernetes/operator/streamsprocessing" "github.com/mongodb/mongodb-atlas-cli/atlascli/internal/store" - "go.mongodb.org/atlas-sdk/v20240805004/admin" + "go.mongodb.org/atlas-sdk/v20240805005/admin" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/client-go/kubernetes/scheme" diff --git a/internal/kubernetes/operator/config_exporter_test.go b/internal/kubernetes/operator/config_exporter_test.go index e7a9ddf2dc..a1c4f332c4 100644 --- a/internal/kubernetes/operator/config_exporter_test.go +++ b/internal/kubernetes/operator/config_exporter_test.go @@ -292,7 +292,7 @@ func TestExportAtlasStreamProcessing(t *testing.T) { ce := NewConfigExporter(atlasOperatorGenericStore, nil, projectID, orgID). WithFeatureValidator(featureValidator). WithTargetNamespace("test"). - WithTargetOperatorVersion("2.4.0") + WithTargetOperatorVersion("2.5.0") resources, err := ce.exportAtlasStreamProcessing("my-project") require.NoError(t, err) @@ -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.4.0", + "mongodb.com/atlas-resource-version": "2.5.0", }, }, Spec: akov2.AtlasStreamInstanceSpec{ @@ -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.4.0", + "mongodb.com/atlas-resource-version": "2.5.0", }, }, Spec: akov2.AtlasStreamConnectionSpec{ @@ -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.4.0", + "mongodb.com/atlas-resource-version": "2.5.0", }, }, Spec: akov2.AtlasStreamConnectionSpec{ @@ -625,7 +625,7 @@ func defaultTestConfigExporter(t *testing.T, genStore *mocks.MockOperatorGeneric return NewConfigExporter(genStore, nil, projectID, orgID). WithTargetNamespace("test"). WithFeatureValidator(featureValidator). - WithTargetOperatorVersion("2.4.0"). + WithTargetOperatorVersion("2.5.0"). WithSecretsData(true) } diff --git a/internal/kubernetes/operator/features/crds.go b/internal/kubernetes/operator/features/crds.go index 02498708da..92207842f5 100644 --- a/internal/kubernetes/operator/features/crds.go +++ b/internal/kubernetes/operator/features/crds.go @@ -27,7 +27,7 @@ import ( ) const ( - LatestOperatorMajorVersion = "2.4.0" + LatestOperatorMajorVersion = "2.5.0" maxDepth = 100 ResourceVersion = "mongodb.com/atlas-resource-version" ResourceAtlasProject = "atlasprojects" @@ -87,6 +87,19 @@ var ( resource{ResourceAtlasStreamConnection, NopPatcher()}, resource{ResourceAtlasBackupCompliancePolicy, NopPatcher()}, }, + "2.5.0": { + resource{ResourceAtlasDatabaseUser, NopPatcher()}, + resource{ResourceAtlasProject, NopPatcher()}, + resource{ResourceAtlasDeployment, NopPatcher()}, + resource{ResourceAtlasBackupSchedule, NopPatcher()}, + resource{ResourceAtlasBackupPolicy, NopPatcher()}, + resource{ResourceAtlasTeam, NopPatcher()}, + resource{ResourceAtlasDataFederation, NopPatcher()}, + resource{ResourceAtlasFederatedAuth, NopPatcher()}, + resource{ResourceAtlasStreamInstance, NopPatcher()}, + resource{ResourceAtlasStreamConnection, NopPatcher()}, + resource{ResourceAtlasBackupCompliancePolicy, NopPatcher()}, + }, } ) diff --git a/internal/kubernetes/operator/streamsprocessing/streamsprocessing_test.go b/internal/kubernetes/operator/streamsprocessing/streamsprocessing_test.go index 703c536f85..0ecfb82cb3 100644 --- a/internal/kubernetes/operator/streamsprocessing/streamsprocessing_test.go +++ b/internal/kubernetes/operator/streamsprocessing/streamsprocessing_test.go @@ -35,7 +35,7 @@ import ( const ( testNamespace = "test" testProjectName = "my-project" - testOperatorVersion = "2.4.0" + testOperatorVersion = "2.5.0" testInstanceName = "instance-0" testCertificate = "-----BEGIN CERTIFICATE-----\nMIIEITCCAwmgAwIBAgIUTLX+HHPxjMxw1pOXEu/+m+aXrgIwDQYJKoZIhvcNAQEL\nBQAwgZ8xCzAJBgNVBAYTAkRFMQ8wDQYDVQQIDAZCZXJsaW4xDzANBgNVBAcMBkJl\ncmxpbjEVMBMGA1UECgwMTW9uZ29EQiBHbWJoMRMwEQYDVQQLDApLdWJlcm5ldGVz\nMRcwFQYDVQQDDA5BdGxhcyBPcGVyYXRvcjEpMCcGCSqGSIb3DQEJARYaaGVsZGVy\nLnNhbnRhbmFAbW9uZ29kYi5jb20wHhcNMjQwNDIzMTE0NzI2WhcNMjcwMTE4MTE0\nNzI2WjCBnzELMAkGA1UEBhMCREUxDzANBgNVBAgMBkJlcmxpbjEPMA0GA1UEBwwG\nQmVybGluMRUwEw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las/kubernetes_config_generate_test.go b/test/e2e/atlas/kubernetes_config_generate_test.go index c778c64972..09038f4cfe 100644 --- a/test/e2e/atlas/kubernetes_config_generate_test.go +++ b/test/e2e/atlas/kubernetes_config_generate_test.go @@ -1310,7 +1310,7 @@ func TestProjectWithStreamsProcessing(t *testing.T) { ), Namespace: targetNamespace, Labels: map[string]string{ - "mongodb.com/atlas-resource-version": "2.4.0", + "mongodb.com/atlas-resource-version": "2.5.0", }, }, Spec: akov2.AtlasStreamInstanceSpec{ @@ -1359,7 +1359,7 @@ func TestProjectWithStreamsProcessing(t *testing.T) { ), Namespace: targetNamespace, Labels: map[string]string{ - "mongodb.com/atlas-resource-version": "2.4.0", + "mongodb.com/atlas-resource-version": "2.5.0", }, }, Spec: akov2.AtlasStreamConnectionSpec{