Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Argo common client #6266

Merged
merged 9 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
common client implementation
  • Loading branch information
iamayushm committed Jan 8, 2025
commit d6585d70e41e508b7386fb51efe70cb6b7b70406
13 changes: 9 additions & 4 deletions Wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ import (
"github.com/devtron-labs/devtron/cel"
"github.com/devtron-labs/devtron/client/argocdServer"
"github.com/devtron-labs/devtron/client/argocdServer/application"
"github.com/devtron-labs/devtron/client/argocdServer/bean"
"github.com/devtron-labs/devtron/client/argocdServer/certificate"
cluster2 "github.com/devtron-labs/devtron/client/argocdServer/cluster"
"github.com/devtron-labs/devtron/client/argocdServer/config"
"github.com/devtron-labs/devtron/client/argocdServer/connection"
"github.com/devtron-labs/devtron/client/argocdServer/repoCredsK8sClient"
repocreds "github.com/devtron-labs/devtron/client/argocdServer/repocreds"
Expand Down Expand Up @@ -229,7 +231,7 @@ func InitializeApp() (*App, error) {
connection.SettingsManager,
// auth.GetConfigForDevtronApps,

connection.GetConfig,
bean.GetConfig,
wire.Bind(new(session2.ServiceClient), new(*middleware.LoginService)),

sse.NewSSE,
Expand Down Expand Up @@ -937,7 +939,7 @@ func InitializeApp() (*App, error) {
wire.Bind(new(imageDigestPolicy.ImageDigestPolicyService), new(*imageDigestPolicy.ImageDigestPolicyServiceImpl)),

certificate.NewServiceClientImpl,
wire.Bind(new(certificate.Client), new(*certificate.ServiceClientImpl)),
wire.Bind(new(certificate.ServiceClient), new(*certificate.ServiceClientImpl)),

appStoreRestHandler.FullModeWireSet,

Expand All @@ -950,14 +952,17 @@ func InitializeApp() (*App, error) {
common.NewDeploymentConfigServiceImpl,
wire.Bind(new(common.DeploymentConfigService), new(*common.DeploymentConfigServiceImpl)),

repoCredsK8sClient.NewRepositorySecret,
wire.Bind(new(repoCredsK8sClient.RepositoryCreds), new(*repoCredsK8sClient.RepositorySecretImpl)),
repoCredsK8sClient.NewRepositoryCredsK8sClientImpl,
wire.Bind(new(repoCredsK8sClient.RepositoryCredsK8sClient), new(*repoCredsK8sClient.RepositoryCredsK8sClientImpl)),

repocreds.NewServiceClientImpl,
wire.Bind(new(repocreds.ServiceClient), new(*repocreds.ServiceClientImpl)),

dbMigration.NewDbMigrationServiceImpl,
wire.Bind(new(dbMigration.DbMigration), new(*dbMigration.DbMigrationServiceImpl)),

config.NewArgoCDConfigGetter,
wire.Bind(new(config.ArgoCDConfigGetter), new(*config.ArgoCDConfigGetterImpl)),
)
return &App{}, nil
}
5 changes: 1 addition & 4 deletions api/appStore/InstalledAppRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (

bean2 "github.com/devtron-labs/devtron/api/bean"
"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/client/argocdServer/application"
"github.com/devtron-labs/devtron/client/cron"
"github.com/devtron-labs/devtron/internal/constants"
"github.com/devtron-labs/devtron/internal/middleware"
Expand Down Expand Up @@ -84,7 +83,6 @@ type InstalledAppRestHandlerImpl struct {
chartGroupService chartGroup.ChartGroupService
validator *validator.Validate
clusterService cluster.ClusterService
acdServiceClient application.ServiceClient
appStoreDeploymentService service.AppStoreDeploymentService
appStoreDeploymentDBService service.AppStoreDeploymentDBService
helmAppClient client.HelmAppClient
Expand All @@ -100,7 +98,7 @@ func NewInstalledAppRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService u
installedAppService FullMode.InstalledAppDBExtendedService,
installedAppResourceService resource.InstalledAppResourceService,
chartGroupService chartGroup.ChartGroupService, validator *validator.Validate, clusterService cluster.ClusterService,
acdServiceClient application.ServiceClient, appStoreDeploymentService service.AppStoreDeploymentService,
appStoreDeploymentService service.AppStoreDeploymentService,
appStoreDeploymentDBService service.AppStoreDeploymentDBService,
helmAppClient client.HelmAppClient,

Expand All @@ -120,7 +118,6 @@ func NewInstalledAppRestHandlerImpl(Logger *zap.SugaredLogger, userAuthService u
chartGroupService: chartGroupService,
validator: validator,
clusterService: clusterService,
acdServiceClient: acdServiceClient,
appStoreDeploymentService: appStoreDeploymentService,
appStoreDeploymentDBService: appStoreDeploymentDBService,
helmAppClient: helmAppClient,
Expand Down
4 changes: 0 additions & 4 deletions api/restHandler/BulkUpdateRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"strings"

"github.com/devtron-labs/devtron/api/restHandler/common"
"github.com/devtron-labs/devtron/client/argocdServer/application"
"github.com/devtron-labs/devtron/client/gitSensor"
"github.com/devtron-labs/devtron/internal/sql/repository/helper"
"github.com/devtron-labs/devtron/internal/sql/repository/pipelineConfig"
Expand Down Expand Up @@ -65,7 +64,6 @@ type BulkUpdateRestHandlerImpl struct {
bulkUpdateService bulkAction.BulkUpdateService
chartService chart.ChartService
propertiesConfigService pipeline.PropertiesConfigService
application application.ServiceClient
userAuthService user.UserService
validator *validator.Validate
teamService team.TeamService
Expand All @@ -86,7 +84,6 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
bulkUpdateService bulkAction.BulkUpdateService,
chartService chart.ChartService,
propertiesConfigService pipeline.PropertiesConfigService,
application application.ServiceClient,
userAuthService user.UserService,
teamService team.TeamService,
enforcer casbin.Enforcer,
Expand All @@ -107,7 +104,6 @@ func NewBulkUpdateRestHandlerImpl(pipelineBuilder pipeline.PipelineBuilder, logg
bulkUpdateService: bulkUpdateService,
chartService: chartService,
propertiesConfigService: propertiesConfigService,
application: application,
userAuthService: userAuthService,
validator: validator,
teamService: teamService,
Expand Down
5 changes: 1 addition & 4 deletions api/restHandler/app/appList/AppListingRestHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/devtron-labs/devtron/api/helm-app/service/read"
"github.com/devtron-labs/devtron/api/restHandler/common"
util3 "github.com/devtron-labs/devtron/api/util"
"github.com/devtron-labs/devtron/client/argocdServer/application"
argoApplication "github.com/devtron-labs/devtron/client/argocdServer/bean"
"github.com/devtron-labs/devtron/client/cron"
"github.com/devtron-labs/devtron/internal/constants"
Expand Down Expand Up @@ -89,7 +88,6 @@ type AppListingRestHandler interface {
}

type AppListingRestHandlerImpl struct {
application application.ServiceClient
appListingService app.AppListingService
enforcer casbin.Enforcer
pipeline pipeline.PipelineBuilder
Expand Down Expand Up @@ -128,7 +126,7 @@ type AppAutocomplete struct {
Clusters []bean5.ClusterBean
}

func NewAppListingRestHandlerImpl(application application.ServiceClient,
func NewAppListingRestHandlerImpl(
appListingService app.AppListingService,
enforcer casbin.Enforcer,
pipeline pipeline.PipelineBuilder,
Expand All @@ -148,7 +146,6 @@ func NewAppListingRestHandlerImpl(application application.ServiceClient,
argoApplicationService argoApplication2.ArgoApplicationService,
) *AppListingRestHandlerImpl {
appListingHandler := &AppListingRestHandlerImpl{
application: application,
appListingService: appListingService,
logger: logger,
pipeline: pipeline,
Expand Down
Loading