cloudfoundry-community/cf-python-client

cf push does not support service parameter

hebelal opened this issue · 2 comments

The following manifest.yml is not supported:

applications:

  • name: my-app
    services:
    • name: my-service1
      parameters:
      foo: bar
      herp: derp
    • name: my-service2
      parameters:
      foo: bar

@hebelal From what I see , it throws error

Traceback (most recent call last):
  File "/home/ben/Documents/workspaces/Webrepos/cf-python-client/main/sandbox.py", line 8, in <module>
    manifests = ManifestReader.load_application_manifests("../test.yml")
  File "/home/ben/Documents/workspaces/Webrepos/cf-python-client/main/cloudfoundry_client/operations/push/validation/manifest.py", line 21, in load_application_manifests
    ManifestReader._validate_manifest(os.path.dirname(manifest_path), manifest)
  File "/home/ben/Documents/workspaces/Webrepos/cf-python-client/main/cloudfoundry_client/operations/push/validation/manifest.py", line 27, in _validate_manifest
    ManifestReader._validate_application_manifest(manifest_directory, app_manifest)
  File "/home/ben/Documents/workspaces/Webrepos/cf-python-client/main/cloudfoundry_client/operations/push/validation/manifest.py", line 40, in _validate_application_manifest
    raise AssertionError("One of path or docker must be set")
AssertionError: One of path or docker must be set

You must set the pathor dockerfield.

Hi,

I receive:

File "workspace/venv/lib/python3.9/site-packages/cloudfoundry_client/operations/push/push.py", line 33, in push
    self._push_application(organization, space, app_manifest, restart)
  File "workspace/venv/lib/python3.9/site-packages/cloudfoundry_client/operations/push/push.py", line 52, in _push_application
    self._bind_services(space, app, app_manifest.get("services", []))
  File "workspace/venv/lib/python3.9/site-packages/cloudfoundry_client/operations/push/push.py", line 326, in _bind_services
    service_instance_guid = service_name_to_instance_guid.get(service_name)
TypeError: unhashable type: 'dict'

I'm very confident that it is coming from my manifest.yml file which contains a parameterised service in my case:

---
applications:
  - name: app_name
    ...
    services:
      - name: service_name
        parameters: { "credential-type": "X509_GENERATED" }
    ...