Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrowserLogin ¶ added in v0.0.61
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
Types ¶
type ApplicationStatus ¶ added in v1.0.8
type ApplicationStatus struct { // Overall health status for the application Health struct { Status HealthStatus } // Overall sync status for the application Sync struct { Status SyncStatus } Resources []Resource }
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 // 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 // AppStatus returns a summary of an application's health status AppStatus(appName string) (ApplicationStatus, error) // DestinationURL returns a URL to an environment's Argo applications DestinationURL(dest terra.Destination) string // DefaultSyncOptions returns default sync options DefaultSyncOptions() SyncOptions }
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.
type HealthStatus ¶ added in v1.0.8
type HealthStatus int
const ( Unknown HealthStatus = iota Progressing Suspended Healthy Degraded Missing )
func (HealthStatus) MarshalYAML ¶ added in v1.0.8
func (h HealthStatus) MarshalYAML() (interface{}, error)
func (HealthStatus) String ¶ added in v1.0.8
func (h HealthStatus) String() string
func (*HealthStatus) UnmarshalYAML ¶ added in v1.0.8
func (h *HealthStatus) UnmarshalYAML(value *yaml.Node) error
type Resource ¶ added in v1.0.8
type Resource struct { Kind string Name string Version string Namespace string Status SyncStatus Health struct { Status HealthStatus `yaml:",omitempty"` Message string `yaml:",omitempty"` } `yaml:",omitempty"` }
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 healthy after syncing WaitHealthy bool // WaitHealthyTimeout how long to wait for the application to become healthy before giving up WaitHealthyTimeoutSeconds int // 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 // StatusReporter pool.StatusReporter StatusReporter pool.StatusReporter }
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 SyncStatus ¶ added in v1.0.8
type SyncStatus int
const ( UnknownSyncStatus SyncStatus = iota Synced OutOfSync )
func (SyncStatus) MarshalYAML ¶ added in v1.0.8
func (s SyncStatus) MarshalYAML() (interface{}, error)
func (SyncStatus) String ¶ added in v1.0.8
func (s SyncStatus) String() string
func (*SyncStatus) UnmarshalYAML ¶ added in v1.0.8
func (s *SyncStatus) UnmarshalYAML(value *yaml.Node) error
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"` }