@@ -30,10 +30,16 @@ import (
3030 "github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes/operator/resources"
3131 "github.com/mongodb/atlas-cli-plugin-kubernetes/internal/version"
3232 "github.com/mongodb/atlas-cli-plugin-kubernetes/test"
33+ akoapi "github.com/mongodb/mongodb-atlas-kubernetes/v2/api"
34+ akov2 "github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1"
35+ akov2common "github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1/common"
36+ akov2status "github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1/status"
3337 "github.com/stretchr/testify/assert"
3438 "github.com/stretchr/testify/require"
3539 atlasv2 "go.mongodb.org/atlas-sdk/v20241113004/admin"
40+ atlasv20250219001 "go.mongodb.org/atlas-sdk/v20250219001/admin"
3641 "go.mongodb.org/atlas/mongodbatlas"
42+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3743)
3844
3945const (
@@ -342,9 +348,6 @@ func RandProjectName() (string, error) {
342348 if err != nil {
343349 return "" , err
344350 }
345- if revision , ok := os .LookupEnv ("revision" ); ok {
346- return fmt .Sprintf ("%v-%s" , n , revision ), nil
347- }
348351 return fmt .Sprintf ("e2e-%v" , n ), nil
349352}
350353
@@ -410,7 +413,7 @@ func getFirstOrgUser() (string, error) {
410413 return "" , fmt .Errorf ("%s (%w)" , string (resp ), err )
411414 }
412415
413- var users atlasv2. PaginatedAppUser
416+ var users atlasv20250219001. PaginatedOrgUser
414417 if err := json .Unmarshal (resp , & users ); err != nil {
415418 return "" , fmt .Errorf ("%w: %s" , err , string (resp ))
416419 }
@@ -827,3 +830,39 @@ func randomString(t *testing.T) string {
827830 }
828831 return fmt .Sprintf ("%x" , n )
829832}
833+
834+ func referenceDataFederation (name , namespace , projectName string , labels map [string ]string ) * akov2.AtlasDataFederation {
835+ dictionary := resources .AtlasNameToKubernetesName ()
836+ return & akov2.AtlasDataFederation {
837+ TypeMeta : metav1.TypeMeta {
838+ Kind : "AtlasDataFederation" ,
839+ APIVersion : "atlas.mongodb.com/v1" ,
840+ },
841+ ObjectMeta : metav1.ObjectMeta {
842+ Name : resources .NormalizeAtlasName (fmt .Sprintf ("%s-%s" , projectName , name ), dictionary ),
843+ Namespace : namespace ,
844+ Labels : labels ,
845+ },
846+ Spec : akov2.DataFederationSpec {
847+ Project : akov2common.ResourceRefNamespaced {
848+ Name : resources .NormalizeAtlasName (projectName , dictionary ),
849+ Namespace : namespace ,
850+ },
851+ Name : name ,
852+ CloudProviderConfig : & akov2.CloudProviderConfig {},
853+ DataProcessRegion : & akov2.DataProcessRegion {
854+ CloudProvider : "AWS" ,
855+ Region : "DUBLIN_IRL" ,
856+ },
857+ Storage : & akov2.Storage {
858+ Databases : nil ,
859+ Stores : nil ,
860+ },
861+ },
862+ Status : akov2status.DataFederationStatus {
863+ Common : akoapi.Common {
864+ Conditions : []akoapi.Condition {},
865+ },
866+ },
867+ }
868+ }
0 commit comments