Cloud Foundry Cloud Controller
Ruby Other
Latest commit b71e4cf Mar 24, 2017 @Gerg Gerg committed with jenspinney Update error handling for assigning droplet to app
- Pull error logic into action
- Create constants for app state


Signed-off-by: Jen Spinney <>
Failed to load latest commit information.
app Update error handling for assigning droplet to app Mar 24, 2017
bin allow console to properly load Nov 12, 2015
bosh CGI escape database password Mar 13, 2017
config Update get app current droplet to use relationships Mar 23, 2017
db/migrations Improve db queries for getting app state Mar 8, 2017
docs Update docs for current_droplet and default iso_segs Mar 24, 2017
lib Deeply symbolize keys in messages Mar 17, 2017
middleware Fix UAAUnavailable error structure to be v2 or v3 style Mar 22, 2017
scripts Change delimiter in setup-local-cc to avoid escaping backslash Mar 22, 2017
spec Update error handling for assigning droplet to app Mar 24, 2017
vendor/errors Fix up error messages for InvalidRelations Mar 15, 2017
.gemnasium.yml Add gemnasium file. Sep 22, 2014
.gitignore move v3 docs into v3 subfolder Jun 8, 2016
.rspec Make rspec backtraces smaller Apr 20, 2016
.rspec_parallel Revert "Revert "Use parallel_tests to run tests in parallel"" Oct 7, 2016
.rubocop.yml Bump rubocop to 0.41 Dec 17, 2016
.ruby-version Bump ruby version to 2.3.3 Dec 7, 2016
.travis.yml Remove unused doc generating rake tasks Feb 22, 2017 Add link to wiki in contributing guidelines Mar 13, 2017
Gemfile limit supported fog storage providers Jan 20, 2017
Gemfile.lock Bump faraday_middleware and azure-core Mar 8, 2017
Guardfile merge cc/ccdb with ccng/ccdb_ng Jun 6, 2014 fix typo Jul 27, 2016
LICENSE Revert "Update License and Notice for project" May 23, 2016
NOTICE Streamline multi-copyright notice Feb 3, 2017 Update Jan 6, 2017 Update Feb 10, 2017
Rakefile Remove unused doc generating rake tasks Feb 22, 2017

Build Status Code Climate Test Coverage

Welcome to the Cloud Controller

Helpful Resources


Cloud Controller

The Cloud Controller provides REST API endpoints to create and manage apps, services, user roles, and more!


The Cloud Controller supports Postgres and Mysql.


The Cloud Controller manages a blobstore for:

  • Resource cache: During package upload resource matching, Cloud Controller will only upload files it doesn't already have in this cache.
  • App packages: Unstaged files for an application
  • Droplets: An executable containing an app and its runtime dependencies
  • Buildpacks: Set of programs that transform packages into droplets
  • Buildpack cache: Cached dependencies and build artifacts to speed up future staging

Cloud Controller currently supports webdav and the following fog connectors:

  • Azure
  • Openstack
  • Local (NFS)
  • Google
  • AWS


The Cloud Controller uses Diego to stage and run apps and tasks.

See Diego Design Notes for more details.


Please read the contributors' guide


TLDR: Always run bundle exec rake before committing

To maintain a consistent and effective approach to testing, please refer to the spec README and keep it up to date, documenting the purpose of the various types of tests.

By default rspec will randomly pick between postgres and mysql.

It will try to connect to those databases with the following connection string: postgres: postgres://postgres@localhost:5432/cc_test mysql: mysql2://root:password@localhost:3306/cc_test

rake db:create will create the above database when the DB environment variable is set to postgres or mysql. You should run this before running rake in order to ensure that the cc_test database exists.

You can specify the full connection string via the DB_CONNECTION_STRING environment variable. Examples:

DB_CONNECTION_STRING="postgres://postgres@localhost:5432/cc_test" rake
DB_CONNECTION_STRING="mysql2://root:password@localhost:3306/cc_test" rake

If you are running the integration specs (which are included in the full rake), and you are specifying DB_CONNECTION_STRING, you will also need to have a second test database with _integration_cc as the name suffix.

For example, if you are using:


You will also need a database called:


Running tests on a single file

The development team typically will run the specs to a single file as (e.g.)

bundle exec rspec spec/controllers/runtime/users_controller_spec.rb

Running all the tests

bundle exec rake spec

Running static analysis

bundle exec rubocop


Cloud Controller uses Steno to manage its logs. Each log entry includes a "source" field to designate which module in the code the entry originates from. Some of the possible sources are '', 'cc.app_stager', 'cc.dea.client' and 'cc.healthmanager.client'.

Here are some use cases for the different log levels:

  • error - the CC received a malformed HTTP request, or a request for a non-existent droplet
  • warn - the CC failed to delete a droplet, CC received a request with an invalid auth token
  • info - CC received a token from UAA, CC received a NATS request
  • debug2 - CC created a service, updated a service
  • debug - CC syncs resource pool, CC uploaded a file


The Cloud Controller uses a YAML configuration file. For an example, see config/cloud_controller.yml.