Unable to delete existing environment variables through manifest file in Tanzu Application Service for VMs
search cancel

Unable to delete existing environment variables through manifest file in Tanzu Application Service for VMs

book

Article ID: 298313

calendar_today

Updated On: 04-22-2024

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

Attempting to delete an existing environment variable by deleting it from the env block of a manifest file does not work.

You may expect setting/unsetting env variables via the manifest file to behave similar to running cf CLI commands, resulting in unexpected behavior.

For example, when developers push new versions of applications using blue/green deployments, old settings are preserved and applied even though the settings have been removed from the manifest.

This happens because, an environment variable is set on the container and belongs to the container’s environment. It persists even when the app is restarted or stopped. Removing the env block from the manifest, only tells cloud foundry to not set the env variable. It is not an instruction to delete it.

For more information, refer to Environment Variables - App Manifest Attribute Reference.

Environment

Product Version: 2.11

Resolution

To delete or modify the environment variables of a running app, do either of the following:
  • Use cf unset-env or cf set-env commands
  • Delete the app and push a new app with the modified manifest, without the env block.