cloudfoundry / cloudfoundry/cloud_controller_ng

App env vars and service binding changes aren't reverted for failed rolling deployment

Open
#3,531 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

A rolling update which is canceled because of an application issue (e.g. failed start) will revert to the latest known droplet version but any changes to environment variables or service bindings will not be reverted.

Steps to Reproduce

  1. Deploy a slightly modified version of the spring-music app which introduces a version and a new env var called TEST by following the instructions available on the readme.
  2. Verify that https://<apphost>/appinfo shows {"profiles":["http2"],"services":[],"version":"1.0.0"} and https://<apphost>/envVarTest shows false
  3. Create a service instance from any type with the name test
  4. Deploy with cf push --strategy rolling another version of the spring-music app which can't start and introduces changes to the app version, the value of the TEST env var and a binding to the test service instance.
  5. The cf push --strategy rolling will fail and with cf droplets <my-app> you can check that the latest droplet isn't the current one, but cf env <my-app> will show the updated version of the env var and that the app is bound to the test service.
  6. Restart the app with cf restart <my-app> Verify that https://<apphost>/appinfo shows {"profiles":["http2"],"services":["test"],"version":"1.0.0"} and https://<apphost>/envVarTest shows true.

Expected result

The env var and service binding changes are not applied for failed rolling deployments.

Current result

Currently the env var and service binding changes are applied to the application.

Possible Fix

One option could be to use the Cloud Foundry API app revisions to revert to the last known good version in such a situation.

Additional Context

Create an issue on the docs side to document the current behaviour.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the failed rolling deployment with the linked spring-music variants, then trace the rolling deployment handling around cf push and the Cloud Foundry API revisions documentation. Done means a canceled failed deployment leaves environment variables and service bindings unchanged, as verified with cf env, cf droplets, and cf restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.