service

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppStoreDeploymentDBService added in v0.7.0

type AppStoreDeploymentDBService interface {
	// AppStoreDeployOperationDB is used to perform Pre-Install DB operations in App Store deployments
	AppStoreDeployOperationDB(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, tx *pg.Tx, requestType appStoreBean.InstallAppVersionRequestType) (*appStoreBean.InstallAppVersionDTO, error)
	// AppStoreDeployOperationStatusUpdate updates the bulk deployment status in repository.InstalledApps
	AppStoreDeployOperationStatusUpdate(installAppId int, status appStoreBean.AppstoreDeploymentStatus) (bool, error)
	// IsChartProviderActive validates if the chart provider for Helm App is active
	IsChartProviderActive(appStoreVersionId int) (bool, error)
	// GetInstalledApp returns - appStoreBean.InstallAppVersionDTO for the given InstalledAppId
	GetInstalledApp(id int) (*appStoreBean.InstallAppVersionDTO, error)
	// GetAllInstalledAppsByAppStoreId returns - []appStoreBean.InstalledAppsResponse for the given AppStoreId
	GetAllInstalledAppsByAppStoreId(appStoreId int) ([]appStoreBean.InstalledAppsResponse, error)
	// UpdateInstalledAppVersionHistoryWithGitHash updates GitHash in the repository.InstalledAppVersionHistory
	UpdateInstalledAppVersionHistoryWithGitHash(versionHistoryId int, gitHash string, userId int32) error
	// UpdateProjectForHelmApp updates TeamId in the app.App
	UpdateProjectForHelmApp(appName, displayName string, teamId int, userId int32) error
	// InstallAppPostDbOperation is used to perform Post-Install DB operations in App Store deployments
	InstallAppPostDbOperation(installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error
	// UpdateInstalledAppVersionHistoryStatus will update the repository.InstalledAppVersionHistory with the given adapter.UpdateVersionHistoryOperation
	UpdateInstalledAppVersionHistoryStatus(versionHistoryId int, opt ...installedAppAdapter.UpdateVersionHistoryOperation) error
	// GetActiveAppForAppIdentifierOrReleaseName returns app db model for an app unique identifier or from display_name if either exists else it throws pg.ErrNoRows
	GetActiveAppForAppIdentifierOrReleaseName(appNameUniqueIdentifier, releaseName string) (*app.App, error)
}

type AppStoreDeploymentDBServiceImpl added in v0.7.0

type AppStoreDeploymentDBServiceImpl struct {
	// contains filtered or unexported fields
}

func NewAppStoreDeploymentDBServiceImpl added in v0.7.0

func NewAppStoreDeploymentDBServiceImpl(logger *zap.SugaredLogger,
	installedAppRepository repository.InstalledAppRepository,
	appStoreApplicationVersionRepository discoverRepository.AppStoreApplicationVersionRepository,
	appRepository app.AppRepository,
	environmentService environment2.EnvironmentService,
	clusterService clusterService.ClusterService,
	installedAppRepositoryHistory repository.InstalledAppVersionHistoryRepository,
	envVariables *globalUtil.EnvironmentVariables,
	gitOpsConfigReadService config.GitOpsConfigReadService,
	deploymentTypeOverrideService providerConfig.DeploymentTypeOverrideService,
	fullModeDeploymentService deployment.FullModeDeploymentService, appStoreValidator AppStoreValidator,
	installedAppDbService EAMode.InstalledAppDBService,
	deploymentConfigService common.DeploymentConfigService) *AppStoreDeploymentDBServiceImpl

func (*AppStoreDeploymentDBServiceImpl) AppStoreDeployOperationDB added in v0.7.0

func (*AppStoreDeploymentDBServiceImpl) AppStoreDeployOperationStatusUpdate added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) AppStoreDeployOperationStatusUpdate(installAppId int, status appStoreBean.AppstoreDeploymentStatus) (bool, error)

func (*AppStoreDeploymentDBServiceImpl) GetActiveAppForAppIdentifierOrReleaseName added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) GetActiveAppForAppIdentifierOrReleaseName(appNameUniqueIdentifier, releaseName string) (*app.App, error)

func (*AppStoreDeploymentDBServiceImpl) GetAllInstalledAppsByAppStoreId added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) GetAllInstalledAppsByAppStoreId(appStoreId int) ([]appStoreBean.InstalledAppsResponse, error)

func (*AppStoreDeploymentDBServiceImpl) GetInstalledApp added in v0.7.0

func (*AppStoreDeploymentDBServiceImpl) InstallAppPostDbOperation added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) InstallAppPostDbOperation(installAppVersionRequest *appStoreBean.InstallAppVersionDTO) error

func (*AppStoreDeploymentDBServiceImpl) IsChartProviderActive added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) IsChartProviderActive(appStoreVersionId int) (bool, error)

func (*AppStoreDeploymentDBServiceImpl) UpdateInstalledAppVersionHistoryStatus added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) UpdateInstalledAppVersionHistoryStatus(versionHistoryId int, opt ...installedAppAdapter.UpdateVersionHistoryOperation) error

func (*AppStoreDeploymentDBServiceImpl) UpdateInstalledAppVersionHistoryWithGitHash added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) UpdateInstalledAppVersionHistoryWithGitHash(versionHistoryId int, gitHash string, userId int32) error

func (*AppStoreDeploymentDBServiceImpl) UpdateProjectForHelmApp added in v0.7.0

func (impl *AppStoreDeploymentDBServiceImpl) UpdateProjectForHelmApp(appName, displayName string, teamId int, userId int32) error

type AppStoreDeploymentService

type AppStoreDeploymentService interface {
	InstallApp(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, ctx context.Context) (*appStoreBean.InstallAppVersionDTO, error)
	UpdateInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error)
	DeleteInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error)
	LinkHelmApplicationToChartStore(ctx context.Context, request *openapi.UpdateReleaseWithChartLinkingRequest, appIdentifier *bean.AppIdentifier, userId int32) (*openapi.UpdateReleaseResponse, bool, error)
	UpdateProjectHelmApp(updateAppRequest *appStoreBean.UpdateProjectHelmAppDTO) error
	// RollbackApplication Here we are handling the request of rollback using this common function
	RollbackApplication(ctx context.Context, request *openapi2.RollbackReleaseRequest, installedApp *appStoreBean.InstallAppVersionDTO, userId int32) (bool, error)
	GetDeploymentHistory(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO) (*bean3.DeploymentHistoryAndInstalledAppInfo, error)
	GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, installedAppVersionHistoryId int) (*openapi.HelmAppDeploymentManifestDetail, error)
	InstallAppByHelm(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, ctx context.Context) (*appStoreBean.InstallAppVersionDTO, error)
	UpdatePreviousDeploymentStatusForAppStore(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, triggeredAt time.Time, err error) error
	MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId, envId int) error
}

type AppStoreDeploymentServiceImpl

type AppStoreDeploymentServiceImpl struct {
	// contains filtered or unexported fields
}

func NewAppStoreDeploymentServiceImpl

func NewAppStoreDeploymentServiceImpl(logger *zap.SugaredLogger,
	installedAppRepository repository.InstalledAppRepository,
	installedAppService EAMode.InstalledAppDBService,
	appStoreDeploymentDBService AppStoreDeploymentDBService,
	chartGroupDeploymentRepository repository3.ChartGroupDeploymentRepository,
	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository,
	appRepository app.AppRepository,
	eaModeDeploymentService deployment2.EAModeDeploymentService,
	fullModeDeploymentService deployment.FullModeDeploymentService,
	environmentService environment.EnvironmentService,
	helmAppService service.HelmAppService,
	installedAppRepositoryHistory repository.InstalledAppVersionHistoryRepository,
	envVariables *util2.EnvironmentVariables,
	aCDConfig *argocdServer.ACDConfig,
	gitOpsConfigReadService config.GitOpsConfigReadService, deletePostProcessor DeletePostProcessor,
	appStoreValidator AppStoreValidator,
	deploymentConfigService common.DeploymentConfigService,
) *AppStoreDeploymentServiceImpl

func (*AppStoreDeploymentServiceImpl) DeleteInstalledApp

func (impl *AppStoreDeploymentServiceImpl) DeleteInstalledApp(ctx context.Context, installAppVersionRequest *appStoreBean.InstallAppVersionDTO) (*appStoreBean.InstallAppVersionDTO, error)

func (*AppStoreDeploymentServiceImpl) GetDeploymentHistory

func (*AppStoreDeploymentServiceImpl) GetDeploymentHistoryInfo

func (impl *AppStoreDeploymentServiceImpl) GetDeploymentHistoryInfo(ctx context.Context, installedApp *appStoreBean.InstallAppVersionDTO, version int) (*openapi.HelmAppDeploymentManifestDetail, error)

func (*AppStoreDeploymentServiceImpl) InstallApp

func (*AppStoreDeploymentServiceImpl) InstallAppByHelm

func (impl *AppStoreDeploymentServiceImpl) InstallAppByHelm(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, ctx context.Context) (*appStoreBean.InstallAppVersionDTO, error)

func (*AppStoreDeploymentServiceImpl) LinkHelmApplicationToChartStore

func (impl *AppStoreDeploymentServiceImpl) LinkHelmApplicationToChartStore(ctx context.Context, request *openapi.UpdateReleaseWithChartLinkingRequest,
	appIdentifier *bean.AppIdentifier, userId int32) (*openapi.UpdateReleaseResponse, bool, error)

func (*AppStoreDeploymentServiceImpl) MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted

func (impl *AppStoreDeploymentServiceImpl) MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId, envId int) error

func (*AppStoreDeploymentServiceImpl) RollbackApplication

func (impl *AppStoreDeploymentServiceImpl) RollbackApplication(ctx context.Context, request *openapi2.RollbackReleaseRequest,
	installedApp *appStoreBean.InstallAppVersionDTO, userId int32) (bool, error)

func (*AppStoreDeploymentServiceImpl) UpdateInstalledApp

func (*AppStoreDeploymentServiceImpl) UpdatePreviousDeploymentStatusForAppStore

func (impl *AppStoreDeploymentServiceImpl) UpdatePreviousDeploymentStatusForAppStore(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, triggeredAt time.Time, err error) error

func (*AppStoreDeploymentServiceImpl) UpdateProjectHelmApp

func (impl *AppStoreDeploymentServiceImpl) UpdateProjectHelmApp(updateAppRequest *appStoreBean.UpdateProjectHelmAppDTO) error

type AppStoreValidator added in v0.7.0

type AppStoreValidator interface {
	Validate(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, environment *bean.EnvironmentBean) error
}

type AppStoreValidatorImpl added in v0.7.0

type AppStoreValidatorImpl struct {
	// contains filtered or unexported fields
}

func NewAppAppStoreValidatorImpl added in v0.7.0

func NewAppAppStoreValidatorImpl(
	logger *zap.SugaredLogger,
) *AppStoreValidatorImpl

func (*AppStoreValidatorImpl) Validate added in v0.7.0

func (impl *AppStoreValidatorImpl) Validate(installAppVersionRequest *appStoreBean.InstallAppVersionDTO, environment *bean.EnvironmentBean) error

type DeletePostProcessor added in v0.7.0

type DeletePostProcessor interface {
	Process(app *app.App, installAppVersionRequest *appStoreBean.InstallAppVersionDTO)
}

type DeletePostProcessorImpl added in v0.7.0

type DeletePostProcessorImpl struct {
	// contains filtered or unexported fields
}

func NewDeletePostProcessorImpl added in v0.7.0

func NewDeletePostProcessorImpl(
	logger *zap.SugaredLogger,
) *DeletePostProcessorImpl

func (*DeletePostProcessorImpl) Process added in v0.7.0

func (impl *DeletePostProcessorImpl) Process(app *app.App, installAppVersionRequest *appStoreBean.InstallAppVersionDTO)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL