cloudfoundry / multiapps-cli-plugin

A CLI plugin for Multi-Target Application (MTA) operations in Cloud Foundry
Apache License 2.0
80 stars 40 forks source link

Config files used in extensions are not uploaded #147

Open MatthiasSchmalz opened 2 years ago

MatthiasSchmalz commented 2 years ago

Description

We have created an mta extension which makes use of the feature include external configurations. E.g. like this: _schema-version: '3.2.0' extends: fdc-cf-service ID: fdc-cf-service.mTLS modules:

We expect that the deployer detects the used json files and uploads them and they are merged into the final mta. However this did not work. In the console we have seen that only the extension got uploaded but not the config.json. Also the parameters have not been in place. I have seen in the deploy log, that it got ignored. The deploy service seems to ignore the missing referenced file silently and did not fail. In case this is a not supported feature we would have expected an error message.

Your environment

Steps to reproduce

Tell us how to reproduce this issue. Have an MTA + an extension which uses an external config Build the MTA Deploy the MTA with the extension => The external config is not used

Additional information

If an multi-target app operation fails, download logs of the operation and provide them as a GIST(s). For more details, see download-mta-op-logs / dmol command provided by CF MTA Plugin. The most important log file is MAIN_LOG.

https://gist.github.com/MatthiasSchmalz/e68e25c71df0177efb862fbaeeaae2b5

IvanBorislavovDimitrov commented 2 years ago

Hi @MatthiasSchmalz,

The config-path is only available in the so-called development descriptor (mta.yaml) and not in the mtad.yaml (deployment descriptor). Tools like MBT build mtad.yaml from mta.yaml and transform this config-path property to a MANIFEST.MF entry located in META-INF/MANIFEST.MF. If you want to use service-binding-parameters provided in file you have to add a MANIFEST entry. Check: https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/c7b09b79d3bb4d348a720ba27fe9a2d5.html?locale=en-US

Name: x509Binding.json MTA-Requires: / Content-Type: application/json

In the extension descriptor in your case you can only hardcode the parameters in the descriptor under config parameter: "ext-desc.mtaext"

resource: my-service
  parameters:
    config:
      credential-type: x509
      x509: ....

These config parameters will be merged with the parameters specified in the mtad.yaml or the service-binding-parameters file. Best regards, Ivan

papersaltserver commented 2 years ago

Try to use path instead of config-path.

name: service
requires:
  name: ui5-flexibility-design-and-configuration-xsuaa
  parameters:
    path:` x509Binding.json

Deployment descriptor for XS Advanced uses config-path https://help.sap.com/viewer/4505d0bdaf4948449b7f7379d24d0f0d/2.0.06/en-US/33548a721e6548688605049792d55295.html, but deployment descriptor for BTP uses just path.