@@ -30,10 +30,16 @@ import (
30
30
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/kubernetes/operator/resources"
31
31
"github.com/mongodb/atlas-cli-plugin-kubernetes/internal/version"
32
32
"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"
33
37
"github.com/stretchr/testify/assert"
34
38
"github.com/stretchr/testify/require"
35
39
atlasv2 "go.mongodb.org/atlas-sdk/v20241113004/admin"
40
+ atlasv20250219001 "go.mongodb.org/atlas-sdk/v20250219001/admin"
36
41
"go.mongodb.org/atlas/mongodbatlas"
42
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
37
43
)
38
44
39
45
const (
@@ -342,9 +348,6 @@ func RandProjectName() (string, error) {
342
348
if err != nil {
343
349
return "" , err
344
350
}
345
- if revision , ok := os .LookupEnv ("revision" ); ok {
346
- return fmt .Sprintf ("%v-%s" , n , revision ), nil
347
- }
348
351
return fmt .Sprintf ("e2e-%v" , n ), nil
349
352
}
350
353
@@ -410,7 +413,7 @@ func getFirstOrgUser() (string, error) {
410
413
return "" , fmt .Errorf ("%s (%w)" , string (resp ), err )
411
414
}
412
415
413
- var users atlasv2. PaginatedAppUser
416
+ var users atlasv20250219001. PaginatedOrgUser
414
417
if err := json .Unmarshal (resp , & users ); err != nil {
415
418
return "" , fmt .Errorf ("%w: %s" , err , string (resp ))
416
419
}
@@ -827,3 +830,39 @@ func randomString(t *testing.T) string {
827
830
}
828
831
return fmt .Sprintf ("%x" , n )
829
832
}
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