cf-python-client icon indicating copy to clipboard operation
cf-python-client copied to clipboard

cf push does not support service parameter

Open hebelal opened this issue 2 years ago • 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 avatar Nov 21 '22 12:11 hebelal

@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.

antechrestos avatar Dec 03 '22 17:12 antechrestos

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" }
    ...

hebelal avatar Dec 05 '22 10:12 hebelal