File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
internal/kubernetes/operator Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -417,9 +417,12 @@ func (e *ConfigExporter) exportAtlasFederatedAuth(projectName string) ([]runtime
417417 // Gets the FederationAuthSetting
418418 federatedAuthentificationSetting , err := e .dataProvider .FederationSetting (& admin.GetFederationSettingsApiParams {OrgId : e .orgID })
419419 if err != nil {
420+ if admin .IsErrorCode (err , "RESOURCE_NOT_FOUND" ) {
421+ return nil , nil
422+ }
420423 return nil , fmt .Errorf ("failed to retrieve federation settings: %w" , err )
421424 }
422- // Does not have an IdenityProvider set then no need to generate
425+ // Does not have an IdentityProvider set then no need to generate
423426 if ! federatedAuthentificationSetting .HasIdentityProviderStatus () || federatedAuthentificationSetting .GetIdentityProviderStatus () == InactiveStatus {
424427 return nil , nil
425428 }
Original file line number Diff line number Diff line change @@ -131,6 +131,26 @@ func InitialSetup(t *testing.T) KubernetesConfigGenerateProjectSuite {
131131 return s
132132}
133133
134+ func TestExportWorksWithoutFedAuth (t * testing.T ) {
135+ s := InitialSetup (t )
136+ cliPath := s .cliPath
137+ generator := s .generator
138+ cmd := exec .Command (cliPath ,
139+ "kubernetes" ,
140+ "config" ,
141+ "generate" ,
142+ "--projectId" ,
143+ generator .projectID )
144+ cmd .Env = os .Environ ()
145+ resp , err := cmd .CombinedOutput ()
146+ t .Log (string (resp ))
147+ require .NoError (t , err , string (resp ))
148+ var objects []runtime.Object
149+ objects , err = getK8SEntities (resp )
150+ require .NoError (t , err , "should not fail on decode but got:\n " + string (resp ))
151+ require .NotEmpty (t , objects )
152+ }
153+
134154func TestFederatedAuthTest (t * testing.T ) {
135155 t .Run ("PreRequisite Get the federation setting ID" , func (t * testing.T ) {
136156 s := InitialSetup (t )
You can’t perform that action at this time.
0 commit comments