ArgoCDStorage¶
- class phalanx.storage.argocd.ArgoCDStorage¶
Bases:
object
Interface to Argo CD operations.
Calls the argocd command-line client. Used primarily by the installer.
Methods Summary
create_environment
(environment, ...)Manually create an Argo CD application.
login
(username, password)Authenticate to Argo CD.
set_project
(application, project)Set the Argo CD project of an application.
sync
(application, *[, timeout])Sync a specific Argo CD application.
sync_all
(app_of_apps_name, *[, timeout])Sync all Argo CD applications under an app of apps.
Methods Documentation
- create_environment(environment, app_of_apps_name, *, git_url, git_branch)¶
Manually create an Argo CD application.
Used only by the installer for installing the app of apps to bootstrap the environment.
- Parameters:
- Raises:
CommandFailedError – Raised if Argo CD fails.
- Return type:
- login(username, password)¶
Authenticate to Argo CD.
Authenticates using username and password authentication with port forwarding. This normally must be done before any other Argo CD operations.
- Parameters:
username (
str
) – Username for authentication. (Usually this will beadmin
.)password (
SecretStr
) – Password for that user.
- Raises:
CommandFailedError – Raised if Argo CD fails.
- Return type:
- set_project(application, project)¶
Set the Argo CD project of an application.
- Parameters:
- Raises:
CommandFailedError – Raised if Argo CD fails.
- Return type:
- sync(application, *, timeout=datetime.timedelta(seconds=120))¶
Sync a specific Argo CD application.
- Parameters:
- Raises:
CommandFailedError – Raised if Argo CD fails.
CommandTimedOutError – Raised if the command timed out. The timeout is also passed to Argo CD as an option, so normally the command should fail and raise
CommandFailedError
instead. This exception means the Argo CD timeout didn’t work for some reason.
- Return type:
- sync_all(app_of_apps_name, *, timeout=datetime.timedelta(seconds=30))¶
Sync all Argo CD applications under an app of apps.
- Parameters:
- Raises:
CommandFailedError – Raised if Argo CD fails.
CommandTimedOutError – Raised if the command timed out. The timeout is also passed to Argo CD as an option, so normally the command should fail and raise
CommandFailedError
instead. This exception means the Argo CD timeout didn’t work for some reason.
- Return type: