Commit graph

153 commits

Author SHA1 Message Date
Andrew Merenbach
5dbbd0a76f
Support UI cluster creation (#469)
* Add kubeconfig string to ClusterCreateRequest

* Update generated files

* Copy and adapt cluster management logic into db

* Add service account deletion to db

* Return errors from new DB methods

* Adapt InstallClusterManagerRBAC for db

* Update errors in db

* Return error if it occurs from db

* Integrate code to (un)install cluster manager

* Use invalid argument instead of failed precondition

* Set bearer token if error is nil

* Rm cluster RBAC install from CLI

* Rm cluster mgmt install from e2e

* Rm common/install.go

* Move install components into server/cluster, thanks @jessesuen

* Rm unneeded ctx arg

* Restore common/installer.go

* Replace all quoted percent-s with percent-q

* Refactor common/installer.go with error returns

* Return errors rather than exiting fatally

* Return proper number of args

* Slim down cluster methods again

* Simplify, simplify, simplify

* Return gRPC error if RBAC could not be installed

* Issue log entries, not print statements

* Fix log import

* Update generated files

* Refactor

* Major cleanup

* Unmarshal context now

* Put claims check after bearer token insertion

* Initial work to use Kubernetes manifest to create a cluster

* Pass context name now

* Wire up prototype

* Add missing parameter for e2e test

* Just read file directly

* Change how we read cluster server

* Support more attributes from localconfig

* Update generated files

* Support incluster flag

* Comment out unused field for now

* Rm previous NewCluster function

* Unmarshal kube config successfully

* Handle insecure clusters, too

* Use existing logic to get config, thanks @jessesuen

* Revert cluster.go to master version

* Update invocations of RBAC installation

* Fix e2e invocation

* Don't remove management account, thanks @jessesuen

* Fix missing error check in e2e test

* Fix missing clientset arg in e2e fixture

* Create kubeclientset for kubeconfig, thanks @jessesuen
2018-08-06 11:27:48 -07:00
Jesse Suen
9f5a718323
Infer username from claims during an argocd relogin (resolves #475) (#483) 2018-07-31 10:05:52 -07:00
Jesse Suen
b0a71612b7
Add argocd relogin command as a convenience around login to current context (#468) 2018-07-26 16:42:54 -07:00
Jesse Suen
0e78172665
Make use of dex refresh tokens and store them into local config. (#456)
* Make use of dex refresh tokens and store them into local config
* API client will automatically redeem OIDC refresh token if auth token expired.
* Stop the practice of reissuing/resigning non-expiring dex claims in API server.
2018-07-25 12:57:31 -07:00
Andrew Merenbach
7b6b945cbf
Show CLI progress for sync and rollback (#393)
* Add ExpiresAt seconds

Per NumericDate having resolution of seconds at https://tools.ietf.org/html/rfc7519#page-6

* Rename expires for clarity; update comments

* Don't use different possible values for now

* Use intermediate variable for expires value

* Add pseudocode comments to session manager

* Update password storage

* Factor out LocalUsers

* Fix compile errors

* Add claim checks

* Support expiry on ReissueClaims tokens

* Set location to UTC for tokens

* Add logging for username

* Fix issuedAt type assertion

* Set mtime to UTC location

* Set second param on mgr.Create

* Update output for sync

* Major refactor

* Reduce verbosity

* Reduce duplicated code some more, thanks @jessesuen

* Move printout

* Move printout to success, not failure

* Revert "Move printout to success, not failure"

This reverts commit 3a6863d8f497c02bd381cf9ed6ff4a642c8bdcb5.

* Print final status on success _or_ failure

* Adjust printouts with frankenparameters

* Major refactor of data pipelining, thanks @jessesuen

* Refactor app state change printouts

* Fix number of Sprintf args

* Use previous format for keys, rather than hash

* Rename res => hook for clarity

* Don't print app resources initially, thanks @jessesuen

* Refactor Fprintf call to Fprintln

* Rename waitUntilOperationCompleted, thanks @jessesuen

* Refactor to merge data on update

* Default to updated for new resource states

* Use map for fields that actually change

* Don't let flapping lead to duplicate printouts

* Simplify caching mechanism
2018-07-25 09:01:50 -07:00
Jesse Suen
a7c7523a8c
Support helm charts and yaml directories as an application source (#432)
* Support helm charts and yaml directories as an application source
* Run e2e test in parallel and increase timeout
2018-07-24 16:37:12 -07:00
dthomson25
3dbb6f3002
Add ksonnet version to version endpoint (#433)
* Add ksonnet version to version endpoint

I needed to move config.go out of the cli package to fix a circular dependency.

* Remove ksonnetVersion field from the ArgoCD version struct
2018-07-20 09:13:16 -07:00
Alexander Matyushentsev
972f639051
Issue #419 - Add ability to dump heap profile by sending SIGUSR2 (#420)
* Issue #419 - Add ability to dump heap profile by sending SIGUSR2

* Regenerate Gopkg.lock
2018-07-17 03:48:30 +03:00
Alexander Matyushentsev
273f99b293
Issue #414 - fix nil pointer in 'argocd cluster add' (#416)
* Issue #414 - fix nil pointer in 'argocd cluster add'

* Add missing nil check
2018-07-16 23:54:12 +03:00
Jesse Suen
48ef2e919e
Rename 'users' service into 'account' service (#415) 2018-07-16 13:52:40 -07:00
Jesse Suen
65b1b083ee
Switch repo-server to use in-memory cache in lieu of redis. Periodically dump stats (#413) 2018-07-16 10:20:16 -07:00
JazminGonzalez-Rivero
062b13e92a Create User Service to support password management (#411)
* create User Api

* update UsersPasswordRequest to UpdatePasswordRequest

* update UserResponse to UpdatePasswordResponse

* current password only needs to be entered once
2018-07-16 02:34:35 -07:00
Jesse Suen
39b9f4d31a
Add ability to terminate a running operation (resolves #379) (#409) 2018-07-13 17:13:31 -07:00
JazminGonzalez-Rivero
76bf77eded
( resolves 375 ) add admin password util. (#394)
* add ability to update password whenneeded

* refactor structire so settingsverifier in settings util

* consolidate more

* move MakeSignature test

* re kick off build

* reretrigger build
2018-07-13 13:45:49 -04:00
Jesse Suen
7b92977889
Improve logging. Prevent some unecessary patches to app (#383) 2018-07-12 12:39:46 -07:00
Jesse Suen
9d921f65f3
Various fixes to sync logic (#370)
* move hook resource state into SyncResult (from operation state)
* fix rollback to use apply based sync
* re-assess sync/health status between each sync phases
* PostSync hook should wait until application is Healthy (resolves #363)
2018-07-11 19:12:30 -07:00
Alexander Matyushentsev
32ba7f468c
Issue #304 - Print information about app conditions (#371)
* Issue #304 - Print information about app conditions

* Reviewer notes: Remove unnecessary space

* Reviewer notes: use comma to separate conditions
2018-07-12 00:03:20 +03:00
Jesse Suen
eb1caf2231
Use hook strategy as the default when performing a sync (#368) 2018-07-10 16:02:55 -07:00
Alexander Matyushentsev
adb84f3d03
Issue #210 - Application controller should not erase previously collected info about resources if repo or cluster is not available (#367) 2018-07-11 00:45:18 +03:00
JazminGonzalez-Rivero
67acd29541
move install functionality from custom to kubectl apply (#327)
* check for keys on server startup

* move manifest to it's own folder

* revert Gopkg.lock changes

* add default password warnings

* update getting started docs

* remove install dependency from e2e test

* fix test pathing

* readding 02* manifests

* set url to blank as default

* update sso docs

* update getting_started to include namespace

* make defaultSetting internal

* remove extra check, should be caught by  settingsMgr.GetSettings() error check

* fix manifests path

* error if configmap is missing, but replace if secret missing

* fix getting started

* set password to hostname

* update comment for initializeSettings

* remove unneeded bitbucket.webhook.uuid

* Gopkg.lock modified
2018-07-10 17:26:07 -04:00
Jesse Suen
b092e1bc7d
Remove unnecessary role privileges from api server (resolves #319). Fix linting issues (#359) 2018-07-09 13:53:45 -07:00
Jesse Suen
9d7d1989e9
Consolidate printing of hook resources with application resources (#358) 2018-07-09 13:46:23 -07:00
Alexander Matyushentsev
7d4dd0fdd5
Issue #304 - Add spec validation condition to application CRD (#360) 2018-07-09 20:45:03 +03:00
Jesse Suen
364415f83a
Move k8s health assessment into a stand-alone library. Use kubectl convert to statically assess health (#356) 2018-07-09 10:13:56 -07:00
Jesse Suen
d633f6b299
Support for PreSync, Sync, PostSync resource hooks (#350)
* Rewrite controller sync logic to support workflow-based sync

* Redesign hook implementation to support generic resources as hooks
2018-07-07 00:54:06 -07:00
Andrew Merenbach
c2fde1ddc0
Retry sync and rollback (#347)
* Add timeout to sync and rollback commands

* Make defaultCheckTimeoutSeconds package-global

* Add cancel to context for rollback, sync

* Add cancel after timeout to rollback/sync

* Assign appName earlier in sync

* Don't unnecessarily reassign ctx

* Use full func for timeout after all

* Try applying wait logic

* Add sync/health flags to rollback/sync

* Slight cleanup to realign with spec

* Clean up, still broken

* Adapt waitUntilOPerationCompleted, thanks @jessesuen

* Log fatal immediately after timeout

* Move fatal log back

* Reduce diff further

* Rm two blank lines
2018-07-03 15:35:58 -07:00
Andrew Merenbach
e58bdab492
Remove namespace from app URL (#334) 2018-06-28 13:57:52 -07:00
Alexander Matyushentsev
f046884ae0
Issue #295 - Add repositories to project spec (#331) 2018-06-27 16:15:26 -07:00
Andrew Merenbach
f4ce59650d
Idempotent cluster create (#328)
* Add upsert field to cluster create request

* Update generated files

* Add idempotence check to cluster

* Add command-line flag for upsert cluster

* Fix error logging in repository, cluster, application create

* Check Server instead of Name
2018-06-27 13:40:32 -07:00
Andrew Merenbach
bc49af56c0
RBAC import/export (#325)
* Simplify export with functional approach

* Add comment

* Export/import RBAC config map now
2018-06-27 13:10:39 -07:00
Alexander Matyushentsev
12b3ec6989
Issue #295 - Allow editing project destinations using CLI (#317)
* Issue #295 - Allow editing projcet destinations using CLI

* Apply reviewer notes

* Fix error message in 'argocd project' cli

* Convert project name to positional argument
2018-06-26 13:49:31 -07:00
Andrew Merenbach
e536cc183a
Idempotent repo add (#321)
* Add upsert field for repo creation

* Update generated files

* Update repo specs

* Redact existing repo

* Use one exit point to reduce chance of redaction error

* Set error to nil when appropriate

* Handle claims more properly

* Process error better

* Fix comparison, rm unneeded assignment

* Use pointers for repo RBAC name

* Apply repoRBACName in two other places

* DRY

* Don't nest unnecessarily

* Revert repoRBACName change to simplify diff

* Rearrange repo upsert check, thanks @jessesuen
2018-06-26 11:51:51 -07:00
Jesse Suen
653f9d3913
Remove local git credential test to prevent clobbering of OSX keychain credentials (resolves #315) 2018-06-24 03:39:05 -07:00
JazminGonzalez-Rivero
4353f736d4
add validation to argocd app set -p (#309)
* Add CheckValidParam function

* fix typo
2018-06-22 14:22:30 -07:00
Alexander Matyushentsev
81021839d5
Issue #295 - implement app destination permissions validation (#310)
* Issue #295 - implement app destination permissions validation

* Apply reviewer notes. Use project to check application access. Update project access checks

* Use GetProject() instead of project to make sure default value is inferred

* Apply reviewer notes
2018-06-22 10:05:57 -07:00
Jesse Suen
834e22d7b1
Support cluster management using the internal k8s API address https://kubernetes.default.svc (#307) 2018-06-20 16:50:15 -07:00
Alexander Matyushentsev
1e29f98924
Issue #295 - add project CRD, basic API and CLI implementation (#299) 2018-06-20 14:48:31 -07:00
Jesse Suen
933f3da538
Support diffing a local ksonnet app to the live application state (resolves #239) (#298) 2018-06-20 13:57:55 -07:00
Jesse Suen
a7fa2fd256
Add ability to show last operation result in app get. Show path in app list -o wide (#297) 2018-06-19 02:04:45 -07:00
Jesse Suen
bcc114ec60
Add ability to force a refresh of an app during get (resolves #269) (#293) 2018-06-18 10:22:58 -07:00
Andrew Merenbach
df0e2e4015
Fail app sync if prune flag is required (#276)
* Add status field to resource details

* Update generated code

* Set up const message responses

* Check number of resources requiring pruning

* Fix imports

* Use string, thanks @alexmt

* Update generated code
2018-06-12 10:54:11 -07:00
Andrew Merenbach
8cf8ad7e24
Tweak flags for import/export, thanks @jessesuen (#268) 2018-06-06 16:32:30 -07:00
Andrew Merenbach
0818f698e6
Support resource import/export (#255)
* Add initial prototype for export

* Add client opts to argocd-util

* Make flags local

* Support output to file without piping

* Add comment to NewExportCommand

* Vastly clean up output, thanks @alexmt @jessesuen

* Nullify operation, thanks @alexmt

* Add additional error check

* Rm extraneous fmt.Sprint

* Clone export command to import

* Flesh out import feature

* Use const string for YAML separator

* Don't export enclosing lists

* Almost finished prototyping import

* Create settings now, too

* Create all resources now

* Nullify certificate before export

* Add JSON annotations, update comment

* Warn, don't fail, if cluster/repo already exist, thanks @alexmt

* Use minus instead of stdin/stdout, thanks @jessesuen
2018-06-06 14:53:14 -07:00
Jesse Suen
0afc671723
Retry argocd app wait connection errors from EOF watch. Show detailed state changes 2018-06-06 11:24:49 -07:00
Jesse Suen
12e7447e9f Implement RBAC support (issue #120) (#263)
* introduce rbac library around casbin
* supports claims enforcement by iteration through user's groups
* supports filtering of resources by level of access
* policy loader and automatic updates from configmap
* support for builtin and userdefined policies
2018-06-05 21:44:13 -07:00
Jesse Suen
febdccfb58
Introduce argocd app manifests for printing the application manifests from git or live (#261) 2018-06-05 12:59:29 -07:00
Jesse Suen
371492bf5c
Handle case where upsert could be nil. Use proper error codes. More RESTful endpoints 2018-05-31 17:54:27 -07:00
Jesse Suen
7df831e96d
Clean up .proto definitions for consistency and reduction of pointer usage (#253) 2018-05-31 17:21:09 -07:00
Andrew Merenbach
4f68a0f634
Wrap method signatures (#249)
* Update application create to use upsert attribute

* Update CLI interface

* Use pointer to upsert

* Rename DeleteApplicationRequest for parity

* Add new ApplicationUpdateRequest wrapper

* Rename RepoUpdateRequest => RepoRESTUpdateRequest

* Add new RepositoryUpdateRequest

* Rename ClusterUpdateRequest -> ClusterRESTUpdateRequest

* Fix var names

* Update var use

* Use intermediate vars for clarity

* Update generated code

* Update mocks

* Update e2e cluster creation
2018-05-31 14:21:08 -07:00
Alexander Matyushentsev
e785abeb8f
Issue #244 - Cluster/Repository connection status (#248) 2018-05-31 13:44:19 -07:00