argocdServer

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 31 Imported by: 28

Documentation

Index

Constants

View Source
const (
	TimeoutSlow                 = 30 * time.Second
	ARGOCD_APPLICATION_TEMPLATE = "./scripts/argo-assets/APPLICATION_TEMPLATE.tmpl"
)
View Source
const DevtronInstalationNs = "devtroncd"

Variables

This section is empty.

Functions

This section is empty.

Types

type ACDConfig added in v0.6.28

type ACDConfig struct {
	ArgoCDAutoSyncEnabled bool `env:"ARGO_AUTO_SYNC_ENABLED" envDefault:"true"` //will gradually switch this flag to false in enterprise
}

func GetACDDeploymentConfig added in v0.6.28

func GetACDDeploymentConfig() (*ACDConfig, error)

type AppTemplate

type AppTemplate struct {
	ApplicationName string
	Namespace       string
	TargetNamespace string
	TargetServer    string
	Project         string
	ValuesFile      string
	RepoPath        string
	RepoUrl         string
	AutoSyncEnabled bool
}

type ArgoClientWrapperService added in v0.6.24

type ArgoClientWrapperService interface {

	// GetArgoAppWithNormalRefresh - refresh app at argocd side
	GetArgoAppWithNormalRefresh(context context.Context, argoAppName string) error

	// SyncArgoCDApplicationIfNeededAndRefresh - if ARGO_AUTO_SYNC_ENABLED=true, app will be refreshed to initiate refresh at argoCD side or else it will be synced and refreshed
	SyncArgoCDApplicationIfNeededAndRefresh(context context.Context, argoAppName string) error

	// UpdateArgoCDSyncModeIfNeeded - if ARGO_AUTO_SYNC_ENABLED=true and app is in manual sync mode or vice versa update app
	UpdateArgoCDSyncModeIfNeeded(ctx context.Context, argoApplication *v1alpha1.Application) (err error)

	// RegisterGitOpsRepoInArgoWithRetry - register a repository in argo-cd with retry mechanism
	RegisterGitOpsRepoInArgoWithRetry(ctx context.Context, gitOpsRepoUrl string, userId int32) error

	// GetArgoAppByName fetches an argoCd app by its name
	GetArgoAppByName(ctx context.Context, appName string) (*v1alpha1.Application, error)

	// PatchArgoCdApp performs a patch operation on an argoCd app
	PatchArgoCdApp(ctx context.Context, dto *bean.ArgoCdAppPatchReqDto) error

	// GetGitOpsRepoName returns the GitOps repository name, configured for the argoCd app
	GetGitOpsRepoName(ctx context.Context, appName string) (gitOpsRepoName string, err error)
}

type ArgoClientWrapperServiceImpl added in v0.6.24

type ArgoClientWrapperServiceImpl struct {
	ACDConfig *ACDConfig
	// contains filtered or unexported fields
}

func NewArgoClientWrapperServiceImpl added in v0.6.24

func NewArgoClientWrapperServiceImpl(logger *zap.SugaredLogger, acdClient application.ServiceClient,
	ACDConfig *ACDConfig, repositoryService repository.ServiceClient, gitOpsConfigReadService config.GitOpsConfigReadService,
	gitOperationService git.GitOperationService) *ArgoClientWrapperServiceImpl

func (*ArgoClientWrapperServiceImpl) CreateRequestForArgoCDSyncModeUpdateRequest added in v0.6.28

func (impl *ArgoClientWrapperServiceImpl) CreateRequestForArgoCDSyncModeUpdateRequest(argoApplication *v1alpha1.Application) *v1alpha1.Application

func (*ArgoClientWrapperServiceImpl) GetArgoAppByName added in v0.6.29

func (impl *ArgoClientWrapperServiceImpl) GetArgoAppByName(ctx context.Context, appName string) (*v1alpha1.Application, error)

func (*ArgoClientWrapperServiceImpl) GetArgoAppWithNormalRefresh added in v0.6.24

func (impl *ArgoClientWrapperServiceImpl) GetArgoAppWithNormalRefresh(context context.Context, argoAppName string) error

func (*ArgoClientWrapperServiceImpl) GetGitOpsRepoName added in v0.6.29

func (impl *ArgoClientWrapperServiceImpl) GetGitOpsRepoName(ctx context.Context, appName string) (gitOpsRepoName string, err error)

func (*ArgoClientWrapperServiceImpl) PatchArgoCdApp added in v0.6.29

func (*ArgoClientWrapperServiceImpl) RegisterGitOpsRepoInArgoWithRetry added in v0.6.29

func (impl *ArgoClientWrapperServiceImpl) RegisterGitOpsRepoInArgoWithRetry(ctx context.Context, gitOpsRepoUrl string, userId int32) error

func (*ArgoClientWrapperServiceImpl) SyncArgoCDApplicationIfNeededAndRefresh added in v0.6.28

func (impl *ArgoClientWrapperServiceImpl) SyncArgoCDApplicationIfNeededAndRefresh(context context.Context, argoAppName string) error

func (*ArgoClientWrapperServiceImpl) UpdateArgoCDSyncModeIfNeeded added in v0.6.28

func (impl *ArgoClientWrapperServiceImpl) UpdateArgoCDSyncModeIfNeeded(ctx context.Context, argoApplication *v1alpha1.Application) (err error)

type ArgoK8sClient

type ArgoK8sClient interface {
	CreateAcdApp(appRequest *AppTemplate, cluster *repository.Cluster, applicationTemplatePath string) (string, error)
	GetArgoApplication(namespace string, appName string, cluster *repository.Cluster) (map[string]interface{}, error)
}

type ArgoK8sClientImpl

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

func NewArgoK8sClientImpl

func NewArgoK8sClientImpl(logger *zap.SugaredLogger,
	k8sUtil *k8s.K8sServiceImpl,
) *ArgoK8sClientImpl

func (ArgoK8sClientImpl) CreateAcdApp

func (impl ArgoK8sClientImpl) CreateAcdApp(appRequest *AppTemplate, cluster *repository.Cluster, applicationTemplatePath string) (string, error)

func (ArgoK8sClientImpl) CreateArgoApplication

func (impl ArgoK8sClientImpl) CreateArgoApplication(namespace string, application string, config *rest.Config) error

func (ArgoK8sClientImpl) GetArgoApplication added in v0.2.27

func (impl ArgoK8sClientImpl) GetArgoApplication(namespace string, appName string, cluster *repository.Cluster) (map[string]interface{}, error)

type VersionService

type VersionService interface {
	CheckVersion() (err error)
	GetVersion() (apiVersion string, err error)
}

type VersionServiceImpl

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

func NewVersionServiceImpl

func NewVersionServiceImpl(logger *zap.SugaredLogger, argoCDConnectionManager connection.ArgoCDConnectionManager) *VersionServiceImpl

func (VersionServiceImpl) CheckVersion

func (service VersionServiceImpl) CheckVersion() (err error)

func (VersionServiceImpl) GetVersion

func (service VersionServiceImpl) GetVersion() (apiVersion string, err error)

GetVersion deprecated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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