After upgrading cf CLI from v6 to v7.4.0 cf push will corrupt environment variable values that have commas. The commas are being removed from the list and converted into one string of numerals.
Note: This behavior doesn't happen on cf CLI v6, only on cf CLI v7.
Below is a table that shows some of the behaviors we can expect to see when using cf CLI v7
Manifest Variable found manifest.yml | Container Environment Variable found running cf env appname |
TEST_ENV: 1,2,3,4 | TEST_ENV: 1234 |
TEST_ENV: '1,2,3,4' | TEST_ENV: 1234 |
TEST_ENV: '"1,2,3,4"' | TEST_ENV: "1,2,3,4" |
TEST_ENV: 1, 2, 3, 4 | TEST_ENV: 1, 2, 3, 4 |
TEST_ENV: '1\,2\,3\,4' | TEST_ENV: 1\,2\,3\,4 |
TEST_ENV: '1\\,2\\,3\\,4' | TEST_ENV: 1\\,2\\,3\\,4 |
This problem is caused by a regression in the cloud controller psych ruby library. A PR Add strict_integer option to parse numbers with commas as strings #537 was merged which resolves this issue and is fixed in TAS 3.0. This fix is also back ported to TAS 2.13.11.
To workaround this issue, simply write the manifest using the following yaml format to ensure the variables are parsed correctly.
--- applications: - name: myapp . . env: TEST_ENV: | 1,2,3,4