cancel
Showing results for 
Search instead for 
Did you mean: 

Where has the MTA deployment Metadata gone on Cloud Foundry?

vfweiss
Participant

Hello all,

Has anything been silently changed in regards to “Metadata” being written by MTA deployments to Cloud Foundry?

We can’t find anything related to it in the What's new, but as of today new deployments no longer list the following in the User-Provided Variables section of an App:

  • MTA_METADATA
  • MTA_MODULE_METADATA
  • MTA_MODULE_PROVIDED_DEPENDENCIES
  • MTA_SERVICES
We were leveraging the “MTA_METADATA” to display the version of the application deployed.

Anybody else ran into this? And if so, is this an intended change? For us this was the easiest way to display in App exactly the deployed version of an App on CF, without having to maintain a version in multiple files.

Thanks in advance 🙂

Accepted Solutions (1)

Accepted Solutions (1)

Dimitar
Product and Topic Expert
Product and Topic Expert

Hello Vincent,

MTA_METADATA was an environment variable used by the MTA deployment service to store metadata about the deployed apps. The benefits are that the metadata is bound to the actual entities it describes.

Roughly 2 years ago the CF Platform started supporting actual metadata (via rest API), much like k8s. The MTA deployment service migrated the metadata to the dedicated platform provided store and stopped (miss)using the user-visible store in order to persist that data.The benefits of that change is that the the detection of MTAs is faster and metadata for additional MTA components is persisted - e.g. service instances.

The format of MTA_METADATA is not maintained in a backwards compatible way ( not a contract/interface). If this had been possible - it should have never been visible to app developers.

I understand that having the deployed MTA package version for each app would be convenient

1. If you require this data in the application, the most simple solution is to add a property to each module which has that value. It would result in an env variable available for app. If you don't want to duplicate values in the mta(d).yaml, yaml anchors can be used. A ${version} parameter is not yet available, but given demand and a use case is available the multiapps-controller project can be enhanced with it.

2. If you require tis data as an operator in the cf cli, the `cf mtas` & `cf mta` commands print it in a human-readable form.

3. Using the APIs to get that data is an option I don't recommend, as it's not user friendly, nor is guaranteed to be backwards compatible.

Note for 2.: if an update procedure has failed and the deployment is half-way through, the printed version value may be ''?' , due to the detected conflict.
If you want to take any automated decisions based on the currently deployed version, you may want to also check-out the state of the last operation for that mta: cf mta-ops --mta <mta-id> --last 1

Best regards,

Answers (0)