@@ -118,14 +118,12 @@ func (impl *GitOpsConfigServiceImpl) ValidateAndCreateGitOpsConfig(config *apiBe
118118 detailedErrorGitOpsConfigResponse := impl .GitOpsValidateDryRun (config )
119119 if len (detailedErrorGitOpsConfigResponse .StageErrorMap ) == 0 {
120120 //create argo-cd user, if not created, here argo-cd integration has to be installed
121- gRPCConfigs , err := impl .argoCDConfigGetter .GetAllGRPCConfigs ()
121+ gRPCConfig , err := impl .argoCDConfigGetter .GetGRPCConfig ()
122122 if err != nil {
123123 impl .logger .Errorw ("error in getting all grpc configs" , "error" , err )
124124 return detailedErrorGitOpsConfigResponse , err
125125 }
126- for _ , gRPCConfig := range gRPCConfigs {
127- _ = impl .argoCDConnectionManager .GetOrUpdateArgoCdUserDetail (gRPCConfig )
128- }
126+ _ = impl .argoCDConnectionManager .GetOrUpdateArgoCdUserDetail (gRPCConfig )
129127 _ , err = impl .createGitOpsConfig (context .Background (), config )
130128 if err != nil {
131129 impl .logger .Errorw ("service err, SaveGitRepoConfig" , "err" , err , "payload" , config )
@@ -178,14 +176,13 @@ func (impl *GitOpsConfigServiceImpl) ValidateAndUpdateGitOpsConfig(config *apiBe
178176 }
179177 }
180178 }
181- gRPCConfigs , err := impl .argoCDConfigGetter .GetAllGRPCConfigs ()
179+ gRPCConfig , err := impl .argoCDConfigGetter .GetGRPCConfig ()
182180 if err != nil {
183181 impl .logger .Errorw ("error in getting all grpc configs" , "error" , err )
184182 return apiBean.DetailedErrorGitOpsConfigResponse {}, err
185183 }
186- for _ , gRPCConfig := range gRPCConfigs {
187- _ = impl .argoCDConnectionManager .GetOrUpdateArgoCdUserDetail (gRPCConfig )
188- }
184+ _ = impl .argoCDConnectionManager .GetOrUpdateArgoCdUserDetail (gRPCConfig )
185+
189186 detailedErrorGitOpsConfigResponse := impl .GitOpsValidateDryRun (config )
190187 if len (detailedErrorGitOpsConfigResponse .StageErrorMap ) == 0 {
191188 err := impl .updateGitOpsConfig (config )
0 commit comments