Commit graph

61 commits

Author SHA1 Message Date
Andrew Merenbach
ab00aef75e
Generate swagger files (#278)
* Generate swagger files

* Add basic Swagger definitions

* Add reposerver swagger file

* Consolidate swagger files

* Move swagger files to swagger-ui directory instead

* Put swagger files in swagger-ui

* Fix order of operations

* Move back to swagger directory

* Serve API server swagger files raw for now

* Serve reposerver swagger files from API server

* Move back to subdirectories, thanks @alexmt

* Fix comment on application Rollback

* Update two more comments

* Fix comment in session.proto

* Update generated code

* Update generated swagger docs

* Fix comment for delete actions in cluster and repository swagger

* Set expected collisions and invoke mixins

* Update generated code

* Create swagger mixins from codegen

* Move swagger.json location, thanks @jazminGonzalez-Rivero

* Add ref cleanup for swagger combined

* Make fewer temp files when generating swagger

* Delete intermediate swagger files

* Serve new file at /swagger.json

* Set up UI server

* Update package lock

* Commit generated swagger.json files

* Add install commands for swagger

* Use ReDoc server instead of Swagger UI server

* Update lockfile

* Make URL paths more consistent

* Update package lock

* Separate out handlers for Swagger UI, JSON

* Rm unnecessary CORS headers

...since we're serving from the app server

* Simplify serving

* Further simplify serving code

* Update package lock

* Factor out swagger serving into util

* Add test for Swagger server

* Use ServeSwaggerUI method to run tests

* Update package lock

* Don't generate swagger for reposerver

* Reset to master Gopkg.lock and server/server.go

* Merge in prev change to server/server.go

* Redo changes to Gopkg.lock

* Fix number of conflicts

* Update generated swagger.json for server

* Fix issue with project feature error
2018-06-25 13:49:38 -07:00
Alexander Matyushentsev
21c3fb905b
Projects bug fixes: GET /api/v1/projects should return default project, (#313)
prevent creating/updating default project, make sure user cannot move
app to project unless it is permitted
2018-06-23 11:38:35 -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
bcc114ec60
Add ability to force a refresh of an app during get (resolves #269) (#293) 2018-06-18 10:22:58 -07:00
Alexander Matyushentsev
3fbbe940a1
Issue #283 - API server incorrectly compose application fully qualified name for RBAC check (#284) 2018-06-13 13:05:39 -07:00
Alexander Matyushentsev
9fa622d63b
Issue #280 - It is impossible to restrict application access by repository URL (#281)
* Issue #280 - It is impossible to restrict application access by repository URL

* Apply reviewer note
2018-06-12 10:43:16 -07:00
Alexander Matyushentsev
aa4291183b
Take into account number of unavailable replicas to decided if deployment is healthy or not (#270)
* Take into account number of unavailable replicas to decided if deployment is healthy or not

* Run one controller for all e2e tests to reduce tests duration

* Apply reviewer notes: use logic from kubectl/rollout_status.go to check deployment health
2018-06-07 11:05:46 -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
Alexander Matyushentsev
54835a0d93
Implement workaround for https://github.com/golang/go/issues/21955 (#256) 2018-06-04 13:52:07 -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
Andrew Merenbach
0f4f1262af
Add Events API endpoint (#237)
* Flesh out initial endpoint

* Update generated code

* Update prototype for list of events

* Update endpoints

* Update initialization of app service

* Use proper interfaces here

* Use event list

* Use preexisting events list struct

* Simplify initial architecture significantly

* Rename ListDirResponse => FileList, thanks @jessesuen

* Rm unneeded error check

* Narrow down event query, thanks @alexmt

* Use tests to fix bug

* Don't reinvent the wheel

* Rm comment

* Add Uid field, thanks @alexmt @jessesuen

* Update generated files

* Support external clusters, thanks @alexmt

* Filter by proper namespace
2018-05-30 15:30:58 -07:00
Alexander Matyushentsev
96c05babe0
Issue #238 - add upsert flag to 'argocd app create' command (#245) 2018-05-30 13:49:20 -07:00
Alexander Matyushentsev
13b090e3bd
Issue #147 - App sync frequently fails due to concurrent app modification (#226) 2018-05-22 09:43:17 -07:00
Andrew Merenbach
f62c825495
Manifest endpoint (#207)
* Add manifests endpoint

* Draft app.go changes

* Fix some issues with imports, symbols, args

* Reduce duplication between components

* Revert "Reduce duplication between components"

This reverts commit 87b166885d53778683bc0a0a826671c2c67dc082.

* Add ManifestQuery type, thanks @jessesuen

* Add required/optional flags to protobuf

* Update generated code

* Add missing pointer dereferences

* Default to app target revision, thanks @jessesuen

* Account for nil
2018-05-17 16:33:04 -07:00
Alexander Matyushentsev
e04d315853
Issue #118 - app delete should be done through controller using finalizers (#206)
* Issue #118 - app delete should be done through controller using finalizers

* Apply reviewer notes: introduce application

* Apply reviewer notes: fix app deletion
2018-05-16 16:30:28 -07:00
Jesse Suen
c9df9c17b7
Default Spec.Source.TargetRevision to HEAD server-side if unspecified (issue #190) 2018-05-15 03:21:21 -07:00
Jesse Suen
92c481330d
App creation was not defaulting to server and namespace defined in app.yaml 2018-05-15 01:35:43 -07:00
Jesse Suen
c61795f71a
Add 'database' library for CRUD operations against repos and clusters. Redact sensitive information (#196) 2018-05-14 11:36:08 -07:00
Alexander Matyushentsev
3dbbcf8918
Move sync logic to contoller (#180)
* Issue #119 - Move sync logic to contoller

* Implement app compare/sycn e2e test

* Fix panic in kube ApplyResource method

* Apply reviewer notes: add separate rollback operation instead of reusing sync for sync and rollback
2018-05-11 11:50:32 -07:00
Andrew Merenbach
b83eac5dc2
Make ApplicationSpec.Destination non-optional, non-pointer (#177)
* Make Destination a non-pointer field

* Rm nil checks for destination; update initialization

* Update codegen

* Rm ResolveServerNamespace function, thanks @jessesuen
2018-05-08 14:09:33 -07:00
Andrew Merenbach
1e1ab636e0
Don't fail when new app has same spec as old (#168) 2018-05-07 13:20:38 -07:00
Jesse Suen
fb2d6b4aff
Refactor repo server and git client (#163)
* added a general purpose GetFile RPC and remove GetKsonnetApp RPC
* reposerver did not talk to kubernetes -- removed all k8s imports
* git client refactored to simply method signatures
2018-05-06 20:51:17 -07:00
Alexander Matyushentsev
1b2f89995c
Issue #155 - Application update failes due to concurrent access (#156) 2018-05-03 15:55:01 -07:00
Alexander Matyushentsev
1d876c7729 Fix compilation error 2018-05-01 11:09:13 -07:00
Alexander Matyushentsev
70465a0520
Issue #147 - Use patch to update recentDeployments field (#149) 2018-05-01 11:05:56 -07:00
Alexander Matyushentsev
3c9845719f
Issue #139 - Application sync should delete 'unexpected' resources (#144)
* Issue #139 - Application sync should delete 'unexpected' resources

* Issue #139 - Add --prune flag to app sync and rollback commands

* Apply reviewer notes: s/skipped/ignored/g; take pruned flag into consideration in dry mode
2018-05-01 10:32:46 -07:00
Jesse Suen
d96d67bb9a
Generate a temporary kubeconfig instead of using kubectl flags when applying resources 2018-04-24 19:10:16 -07:00
Jesse Suen
19c3b87676
Bump version to 0.4.0. argocd app sync --dry-run was incorrectly appending items to history (resolves #127) 2018-04-24 17:55:44 -07:00
Alexander Matyushentsev
d71bbf0d9a
Allow overriding server or namespace separately (#126) 2018-04-24 15:26:57 -07:00
Jesse Suen
36b3b2b853
Switch to gogo/protobuf for golang code generation in order to use gogo extensions 2018-04-24 15:20:59 -07:00
Alexander Matyushentsev
63dafa08cc
Issue #110 - Rollback ignores parameter overrides (#117)
* Issue #110 - Rollback ignores parameter overrides

* Issue #110 - Move rollback functionality to separate API endpoint

* Use status.Errorf to report invalid rollback id parameter
2018-04-24 13:34:03 -07:00
Jesse Suen
276e0674c3
Deployment of resources is performed using kubectl apply (resolves #106) 2018-04-22 00:57:05 -07:00
Jesse Suen
b24e478224 Add application validation 2018-04-20 16:37:54 -07:00
Alexander Matyushentsev
e719035ea5
Allow ignoring recource deletion related errors while deleting application (#98)
* Allow ignoring recource deletion related errors while deleting application

* Rename IgnoreResourceDeletionError to Force
2018-04-18 14:27:37 -07:00
Alexander Matyushentsev
150b51a3ac Fix linter warning 2018-04-09 10:44:00 -07:00
Alexander Matyushentsev
0002f8db9e Issue #75 - Implement delete pod API 2018-04-09 10:40:26 -07:00
Alexander Matyushentsev
59ed50d230 Issue #74 - Implement stream logs API 2018-04-06 13:08:29 -07:00
Alexander Matyushentsev
820b4bac1a Remove obsolete pods api 2018-04-06 10:05:25 -07:00
Alexander Matyushentsev
19c5ecdbfa Check app label on client side before deleting app resource 2018-04-06 08:47:02 -07:00
Alexander Matyushentsev
66b0702c24 Issue #65 - Delete all the kube object once app is removed 2018-04-06 08:27:51 -07:00
Alexander Matyushentsev
59dbe8d7ea
Maintain list of recent deployments in app CRD (#59) 2018-03-28 17:35:48 -07:00
Alexander Matyushentsev
10a8d521ef
Add application source and component parameters into recentDeployment field of application CRD (#53)
* Add application source and component parameters into recentDeployment field of application CRD

* Fix broken test
2018-03-26 11:37:38 -07:00
Alexander Matyushentsev
234ace173e
Replace ephemeral environments with override parameters (#52) 2018-03-26 08:28:56 -07:00
Alexander Matyushentsev
5c062bd3e5
Support deploying/destroying ephemeral environments (#40)
* Support deploying ephemeral environments

* Support deleting application resources

* Fix merge conflict

* Add missing break statement
2018-03-16 16:17:03 -07:00
Andrew Merenbach
98754c7fe1
Persist parameters during deployment (Sync) (#39)
* Add basic skeleton for improvements

* Update protobuf config for repository API

* Update skeleton of deploy params code

* Add DeploymentInfo struct

* Add comment, comment out code

* Update repository.pb.go

* Update comment in repository.proto

* Update reposerver subpackage

* Comment out for now

* Start getting function into shape

* Flesh out logic further

* Get unit test started for TestListEnvParams

* Add missing interface declaration

* Finish unit test for ListEnvParams

* Use string literals for regexp.MustCompile

* Clean up RPC response code

* Use map[string]interface{} for now, thanks @alexmt

* First draft attempt to integrate deployment info retrieval

* Install more wiring

* DRY

* Move CRD update to after successful deployment, thanks @alexmt

* Move app params update to after successful deployment, too

* Don't replace application status, thanks @alexmt

* Convert to string types

* Don't create unused var

* Log received values

* Unquote quoted params

* Use string as value type

* Use named returns, no magic number

* Use map for gRPC data transfer

* Update generated code

* Log actual map, not wrapper object

* Fix unit test
2018-03-16 14:58:59 -07:00
Andrew Merenbach
0368c2eadf Allow use of public repos without prior registration (#36)
* Instantiate repo anonymously if it doesn't exist

* Assume public repository if retrieval fails

* Update documentation, blame @merenbach

* Rm obsolete line from GETTING_STARTED.md
2018-03-14 16:28:43 -07:00
Jesse Suen
3a1338be8b
Add ability to override the server and namespace defined in ksonnet env when enabling an app 2018-03-09 02:33:55 -08:00