argocdServer

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 38 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"
View Source
const (
	ErrorOperationAlreadyInProgress = "another operation is already in progress" // this string is returned from argocd
)

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
	RegisterRepoMaxRetryCount int  `env:"ARGO_REPO_REGISTER_RETRY_COUNT" envDefault:"3"`
	RegisterRepoMaxRetryDelay int  `env:"ARGO_REPO_REGISTER_RETRY_DELAY" envDefault:"10"`
}

func GetACDDeploymentConfig added in v0.6.28

func GetACDDeploymentConfig() (*ACDConfig, error)

func (*ACDConfig) IsAutoSyncEnabled added in v0.7.0

func (config *ACDConfig) IsAutoSyncEnabled() bool

func (*ACDConfig) IsManualSyncEnabled added in v0.7.0

func (config *ACDConfig) IsManualSyncEnabled() bool

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

	// IsArgoAppPatchRequired decides weather the v1alpha1.ApplicationSource requires to be updated
	IsArgoAppPatchRequired(argoAppSpec *v1alpha1.ApplicationSource, currentGitRepoUrl, currentChartPath string) bool

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

	GetGitOpsRepoURL(ctx context.Context, appName string) (gitOpsRepoURL 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, asyncRunnable *async.Runnable) *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(ctx 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) GetGitOpsRepoURL added in v0.7.1

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

func (*ArgoClientWrapperServiceImpl) IsArgoAppPatchRequired added in v0.7.0

func (impl *ArgoClientWrapperServiceImpl) IsArgoAppPatchRequired(argoAppSpec *v1alpha1.ApplicationSource, currentGitRepoUrl, currentChartPath string) bool

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(ctx 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(ctx context.Context, appRequest *AppTemplate, 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(ctx context.Context, appRequest *AppTemplate, applicationTemplatePath string) (string, error)

func (ArgoK8sClientImpl) CreateArgoApplication

func (impl ArgoK8sClientImpl) CreateArgoApplication(ctx context.Context, 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