argocd

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationName

func ApplicationName(release terra.Release) string

ApplicationName name of the primary argo application for a release, eg. cromwell-dev

func BrowserLogin added in v0.0.61

func BrowserLogin(thelmaConfig config.Config, shellRunner shell.Runner, iapToken string) error

BrowserLogin is a thin wrapper around the `argocd login --sso` command, which: * presents users with a web UI to log in with their GitHub SSO credentials (same flow as logging in to the ArgoCD webapp) * uses those SSO credentials to generate a new ArgoCD authentication token for the user's identity * stores the generated token in ~/.argocd/config

func EnvironmentSelector added in v0.0.35

func EnvironmentSelector(env terra.Environment) map[string]string

EnvironmentSelector returns set of selectors for all argo apps associated with an environment

func GeneratorName added in v0.0.39

func GeneratorName(destination terra.Destination) string

GeneratorName name of a destinations app generator, eg. "terra-dev-generator"

func LegacyConfigsApplicationName

func LegacyConfigsApplicationName(release terra.Release) string

LegacyConfigsApplicationName name of the firecloud-develop application for a release, eg. cromwell-configs-dev

func ProjectName

func ProjectName(destination terra.Destination) string

ProjectName name of the project for the release. eg. terra-dev, cluster-terra-dev

Types

type ArgoCD

type ArgoCD interface {
	// SyncApp will sync an ArgoCD app
	SyncApp(appName string, options ...SyncOption) (SyncResult, error)
	// HardRefresh will hard refresh an ArgoCD app (force a manifest re-render without a corresponding git change)
	HardRefresh(appName string) error
	// WaitHealthy will wait for an ArgoCD app to become healthy (but not necessarily synced)
	WaitHealthy(appName string) error
	// WaitExist will wait for an ArgoCD app to exist
	WaitExist(appName string, options ...WaitExistOption) error
	// SyncRelease will sync a Terra release's ArgoCD app(s), including the legacy configs app if there is one
	SyncRelease(release terra.Release, options ...SyncOption) error
	// SyncReleases will sync the ArgoCD apps for multiple Terra releases in parallel
	SyncReleases(releases []terra.Release, maxParallel int, options ...SyncOption) error
}

ArgoCD is for running `argocd` commands. Note: we explored using the ArgoCD golang client, but the ArgoCD API is gRPC and designed for async UI communication. As a result it is extremely complicated to do things that are trivial via the CLI.

func New

func New(thelmaConfig config.Config, shellRunner shell.Runner, iapToken string, vaultClient *vaultapi.Client) (ArgoCD, error)

New return a new ArgoCD client

type SyncOption

type SyncOption func(options *SyncOptions)

type SyncOptions

type SyncOptions struct {
	// HardRefresh if true, perform a hard refresh before syncing Argo apps
	HardRefresh bool
	// SyncIfNoDiff if true, sync even if the hard refresh indicates there are no config differences
	SyncIfNoDiff bool
	// WaitHealthy if true, wait for the application to become healhty after syncing
	WaitHealthy bool
	// OnlyLabels if not empty, only sync resources with the given labels
	OnlyLabels map[string]string
	// SkipLegacyConfigsRestart if true, do not restart deployments to pick up firecloud-develop changes
	SkipLegacyConfigsRestart bool
}

SyncOptions options for an ArgoCD sync operation

type SyncResult added in v0.0.55

type SyncResult struct {
	// Synced true if the app was actually synced, false if not
	Synced bool
}

SyncResult stores information about the outcome of a Sync operation

type WaitExistOption added in v0.0.55

type WaitExistOption func(options *WaitExistOptions)

type WaitExistOptions added in v0.0.55

type WaitExistOptions struct {
	// WaitExistTimeoutSeconds how long to wait for an application to exist before timing out
	WaitExistTimeoutSeconds int `default:"300"`

	// WaitExistPollIntervalSeconds how long to wait between polling attempts while waiting for an app to exist
	WaitExistPollIntervalSeconds int `default:"5"`
}

Jump to

Keyboard shortcuts

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