Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 49 Imported by: 26

Documentation

Index

Constants

View Source
const (
	DaemonSetPodDeleteError  = "cannot delete DaemonSet-managed Pods"
	DnsLookupNoSuchHostError = "no such host"
	TimeoutError             = "timeout"
	NotFound                 = "not found"
	ConnectionRefused        = "connection refused"
)

Variables

This section is empty.

Functions

func DecodeExternalAppAppId added in v0.7.0

func DecodeExternalAppAppId(appId string) (*bean.AppIdentifier, error)

func GetDeployedAppName added in v1.4.0

func GetDeployedAppName(appDto bean3.DeployedInstalledAppInfo) string

func GetStatusCode added in v0.7.2

func GetStatusCode(err error) int

func HibernateReqAdaptor added in v0.7.2

func HibernateReqAdaptor(hibernateRequest *openapi.HibernateRequest) *gRPC.HibernateRequest

func HibernateResponseAdaptor added in v0.7.2

func HibernateResponseAdaptor(in []*gRPC.HibernateStatus) []*openapi.HibernateStatus

func IsClusterUnReachableError

func IsClusterUnReachableError(err error) bool

func IsDaemonSetPodDeleteError

func IsDaemonSetPodDeleteError(err error) bool

func IsNodeNotFoundError

func IsNodeNotFoundError(err error) bool

Types

type HelmAppService

type HelmAppService interface {
	ListHelmApplications(ctx context.Context, clusterIds []int, w http.ResponseWriter, token string, helmAuth func(token string, object string) bool)
	GetApplicationDetail(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.AppDetail, error)
	GetApplicationAndReleaseStatus(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.AppStatus, error)
	GetApplicationDetailWithFilter(ctx context.Context, app *helmBean.AppIdentifier, resourceTreeFilter *gRPC.ResourceTreeFilter) (*gRPC.AppDetail, error)
	HibernateApplication(ctx context.Context, app *helmBean.AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
	UnHibernateApplication(ctx context.Context, app *helmBean.AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)
	DecodeAppId(appId string) (*helmBean.AppIdentifier, error)
	EncodeAppId(appIdentifier *helmBean.AppIdentifier) string
	GetDeploymentHistory(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.HelmAppDeploymentHistory, error)
	GetValuesYaml(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.ReleaseInfo, error)
	GetDesiredManifest(ctx context.Context, app *helmBean.AppIdentifier, resource *openapi.ResourceIdentifier) (*openapi.DesiredManifestResponse, error)
	DeleteApplication(ctx context.Context, app *helmBean.AppIdentifier) (*openapi.UninstallReleaseResponse, error)
	DeleteDBLinkedHelmApplication(ctx context.Context, appIdentifier *helmBean.AppIdentifier, useId int32) (*openapi.UninstallReleaseResponse, error)
	// UpdateApplication is a wrapper over helmAppClient.UpdateApplication, sends update request to kubelink for external chart store apps
	UpdateApplication(ctx context.Context, app *helmBean.AppIdentifier, request *bean.UpdateApplicationRequestDto) (*openapi.UpdateReleaseResponse, error)
	GetDeploymentDetail(ctx context.Context, app *helmBean.AppIdentifier, version int32) (*openapi.HelmAppDeploymentManifestDetail, error)
	InstallRelease(ctx context.Context, clusterId int, installReleaseRequest *gRPC.InstallReleaseRequest) (*gRPC.InstallReleaseResponse, error)
	// UpdateApplicationWithChartInfo is a wrapper over helmAppClient.UpdateApplicationWithChartInfo sends update request to kubelink for helm chart store apps
	UpdateApplicationWithChartInfo(ctx context.Context, clusterId int, request *bean.UpdateApplicationWithChartInfoRequestDto) (*openapi.UpdateReleaseResponse, error)
	IsReleaseInstalled(ctx context.Context, app *helmBean.AppIdentifier) (bool, error)
	RollbackRelease(ctx context.Context, app *helmBean.AppIdentifier, version int32) (bool, error)
	GetDevtronHelmAppIdentifier() *helmBean.AppIdentifier
	UpdateApplicationWithChartInfoWithExtraValues(ctx context.Context, appIdentifier *helmBean.AppIdentifier, chartRepository *gRPC.ChartRepository, extraValues map[string]interface{}, extraValuesYamlUrl string, useLatestChartVersion bool) (*openapi.UpdateReleaseResponse, error)
	TemplateChart(ctx context.Context, templateChartRequest *openapi2.TemplateChartRequest) (*openapi2.TemplateChartResponse, error)
	GetNotes(ctx context.Context, request *gRPC.InstallReleaseRequest) (string, error)
	ValidateOCIRegistry(ctx context.Context, OCIRegistryRequest *gRPC.RegistryCredential) (bool, error)
	GetRevisionHistoryMaxValue(appType bean.SourceAppType) int32
	GetResourceTreeForExternalResources(ctx context.Context, clusterId int, clusterConfig *gRPC.ClusterConfig, resources []*gRPC.ExternalResourceDetail) (*gRPC.ResourceTreeResponse, error)
	CheckIfNsExistsForClusterIds(clusterIdToNsMap map[int]string) error
	ListHelmApplicationsForClusterOrEnv(ctx context.Context, clusterId, envId int) ([]helmBean.ExternalHelmAppListingResult, error)
	GetAppStatusV2(ctx context.Context, req *gRPC.AppDetailRequest, clusterId int) (*gRPC.AppStatus, error)
	GetReleaseDetails(ctx context.Context, releaseClusterId int, releaseName, releaseNamespace string) (*gRPC.DeployedAppDetail, error)
}

type HelmAppServiceImpl

type HelmAppServiceImpl struct {
	K8sUtil *k8s.K8sServiceImpl

	ClusterReadService read2.ClusterReadService
	// contains filtered or unexported fields
}

func NewHelmAppServiceImpl

func NewHelmAppServiceImpl(Logger *zap.SugaredLogger, clusterService cluster.ClusterService,
	helmAppClient gRPC.HelmAppClient, pump connector.Pump, enforcerUtil rbac.EnforcerUtilHelm,
	serverDataStore *serverDataStore.ServerDataStore, serverEnvConfig *serverEnvConfig.ServerEnvConfig,
	appStoreApplicationVersionRepository appStoreDiscoverRepository.AppStoreApplicationVersionRepository,
	environmentService environment.EnvironmentService, pipelineRepository pipelineConfig.PipelineRepository,
	installedAppRepository repository.InstalledAppRepository, appRepository app.AppRepository,
	clusterRepository clusterRepository.ClusterRepository, K8sUtil *k8s.K8sServiceImpl,
	helmReleaseConfig *HelmReleaseConfig,
	helmAppReadService read.HelmAppReadService,
	ClusterReadService read2.ClusterReadService,
	installedAppDBService EAMode.InstalledAppDBService) *HelmAppServiceImpl

func (*HelmAppServiceImpl) CheckIfNsExistsForClusterIds added in v0.7.0

func (impl *HelmAppServiceImpl) CheckIfNsExistsForClusterIds(clusterIdToNsMap map[int]string) error

func (*HelmAppServiceImpl) DecodeAppId

func (impl *HelmAppServiceImpl) DecodeAppId(appId string) (*helmBean.AppIdentifier, error)

func (*HelmAppServiceImpl) DeleteApplication

func (*HelmAppServiceImpl) DeleteDBLinkedHelmApplication

func (impl *HelmAppServiceImpl) DeleteDBLinkedHelmApplication(ctx context.Context, appIdentifier *helmBean.AppIdentifier, userId int32) (*openapi.UninstallReleaseResponse, error)

func (*HelmAppServiceImpl) EncodeAppId

func (impl *HelmAppServiceImpl) EncodeAppId(appIdentifier *helmBean.AppIdentifier) string

func (*HelmAppServiceImpl) GetAppStatusV2 added in v1.2.1

func (impl *HelmAppServiceImpl) GetAppStatusV2(ctx context.Context, req *gRPC.AppDetailRequest, clusterId int) (*gRPC.AppStatus, error)

func (*HelmAppServiceImpl) GetApplicationAndReleaseStatus

func (impl *HelmAppServiceImpl) GetApplicationAndReleaseStatus(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.AppStatus, error)

func (*HelmAppServiceImpl) GetApplicationDetail

func (impl *HelmAppServiceImpl) GetApplicationDetail(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.AppDetail, error)

func (*HelmAppServiceImpl) GetApplicationDetailWithFilter

func (impl *HelmAppServiceImpl) GetApplicationDetailWithFilter(ctx context.Context, app *helmBean.AppIdentifier, resourceTreeFilter *gRPC.ResourceTreeFilter) (*gRPC.AppDetail, error)

func (*HelmAppServiceImpl) GetDeploymentDetail

func (*HelmAppServiceImpl) GetDeploymentHistory

func (impl *HelmAppServiceImpl) GetDeploymentHistory(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.HelmAppDeploymentHistory, error)

func (*HelmAppServiceImpl) GetDesiredManifest

func (*HelmAppServiceImpl) GetDevtronHelmAppIdentifier

func (impl *HelmAppServiceImpl) GetDevtronHelmAppIdentifier() *helmBean.AppIdentifier

func (*HelmAppServiceImpl) GetNotes

func (impl *HelmAppServiceImpl) GetNotes(ctx context.Context, request *gRPC.InstallReleaseRequest) (string, error)

func (*HelmAppServiceImpl) GetReleaseDetails added in v1.4.0

func (impl *HelmAppServiceImpl) GetReleaseDetails(ctx context.Context, releaseClusterId int, releaseName, releaseNamespace string) (*gRPC.DeployedAppDetail, error)

func (*HelmAppServiceImpl) GetResourceTreeForExternalResources

func (impl *HelmAppServiceImpl) GetResourceTreeForExternalResources(ctx context.Context, clusterId int,
	clusterConfig *gRPC.ClusterConfig, resources []*gRPC.ExternalResourceDetail) (*gRPC.ResourceTreeResponse, error)

func (*HelmAppServiceImpl) GetRevisionHistoryMaxValue

func (impl *HelmAppServiceImpl) GetRevisionHistoryMaxValue(appType bean.SourceAppType) int32

func (*HelmAppServiceImpl) GetValuesYaml

func (impl *HelmAppServiceImpl) GetValuesYaml(ctx context.Context, app *helmBean.AppIdentifier) (*gRPC.ReleaseInfo, error)

func (*HelmAppServiceImpl) HibernateApplication

func (impl *HelmAppServiceImpl) HibernateApplication(ctx context.Context, app *helmBean.AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)

func (*HelmAppServiceImpl) InstallRelease

func (impl *HelmAppServiceImpl) InstallRelease(ctx context.Context, clusterId int, installReleaseRequest *gRPC.InstallReleaseRequest) (*gRPC.InstallReleaseResponse, error)

func (*HelmAppServiceImpl) IsAppExcludedCheck added in v1.4.0

func (impl *HelmAppServiceImpl) IsAppExcludedCheck(deployedApp helmBean.ExternalHelmAppListingResult, deploymentAppClusterId int, deploymentAppName, deploymentAppNamespace string) bool

func (*HelmAppServiceImpl) IsReleaseInstalled

func (impl *HelmAppServiceImpl) IsReleaseInstalled(ctx context.Context, app *helmBean.AppIdentifier) (bool, error)

func (*HelmAppServiceImpl) ListHelmApplicationForCluster added in v1.4.0

func (impl *HelmAppServiceImpl) ListHelmApplicationForCluster(ctx context.Context, clusterId int) ([]helmBean.ExternalHelmAppListingResult, error)

func (*HelmAppServiceImpl) ListHelmApplicationForEnvironment added in v1.4.0

func (impl *HelmAppServiceImpl) ListHelmApplicationForEnvironment(ctx context.Context, envId int) ([]helmBean.ExternalHelmAppListingResult, error)

func (*HelmAppServiceImpl) ListHelmApplications

func (impl *HelmAppServiceImpl) ListHelmApplications(ctx context.Context, clusterIds []int, w http.ResponseWriter, token string, helmAuth func(token string, object string) bool)

func (*HelmAppServiceImpl) ListHelmApplicationsForClusterOrEnv added in v1.4.0

func (impl *HelmAppServiceImpl) ListHelmApplicationsForClusterOrEnv(ctx context.Context, clusterId, envId int) ([]helmBean.ExternalHelmAppListingResult, error)

func (*HelmAppServiceImpl) RollbackRelease

func (impl *HelmAppServiceImpl) RollbackRelease(ctx context.Context, app *helmBean.AppIdentifier, version int32) (bool, error)

func (*HelmAppServiceImpl) TemplateChart

func (impl *HelmAppServiceImpl) TemplateChart(ctx context.Context, templateChartRequest *openapi2.TemplateChartRequest) (*openapi2.TemplateChartResponse, error)

func (*HelmAppServiceImpl) UnHibernateApplication

func (impl *HelmAppServiceImpl) UnHibernateApplication(ctx context.Context, app *helmBean.AppIdentifier, hibernateRequest *openapi.HibernateRequest) ([]*openapi.HibernateStatus, error)

func (*HelmAppServiceImpl) UpdateApplication

func (*HelmAppServiceImpl) UpdateApplicationWithChartInfo

func (impl *HelmAppServiceImpl) UpdateApplicationWithChartInfo(ctx context.Context, clusterId int,
	request *bean.UpdateApplicationWithChartInfoRequestDto) (*openapi.UpdateReleaseResponse, error)

func (*HelmAppServiceImpl) UpdateApplicationWithChartInfoWithExtraValues

func (impl *HelmAppServiceImpl) UpdateApplicationWithChartInfoWithExtraValues(ctx context.Context, appIdentifier *helmBean.AppIdentifier,
	chartRepository *gRPC.ChartRepository, extraValues map[string]interface{}, extraValuesYamlUrl string, useLatestChartVersion bool) (*openapi.UpdateReleaseResponse, error)

func (*HelmAppServiceImpl) ValidateOCIRegistry

func (impl *HelmAppServiceImpl) ValidateOCIRegistry(ctx context.Context, OCIRegistryRequest *gRPC.RegistryCredential) (bool, error)

type HelmReleaseConfig

type HelmReleaseConfig struct {
	RevisionHistoryLimitDevtronApp      int `env:"REVISION_HISTORY_LIMIT_DEVTRON_APP" envDefault:"1" description:"Count for devtron application rivision history"`
	RevisionHistoryLimitHelmApp         int `` /* 139-byte string literal not displayed */
	RevisionHistoryLimitExternalHelmApp int `` /* 128-byte string literal not displayed */
	RevisionHistoryLimitLinkedHelmApp   int `env:"REVISION_HISTORY_LIMIT_LINKED_HELM_APP" envDefault:"15"`
}

CATEGORY=CD

func GetHelmReleaseConfig

func GetHelmReleaseConfig() (*HelmReleaseConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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