CermakM / argo-client-python

Python client for Argo Workflows | Mirrored to https://github.com/argoproj-labs/argo-client-python
https://github.com/argoproj/argo
Apache License 2.0
31 stars 8 forks source link

Cannot create_namespaced_workflow; Status cannot be None #15

Closed pkrishn6 closed 4 years ago

pkrishn6 commented 4 years ago

Trying to submit a hello-world.yaml (https://github.com/argoproj/argo/blob/master/examples/hello-world.yaml).

Hit this issue: https://github.com/CermakM/argo-client-python/issues/11

Adding name to the container results in

File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api/v1alpha1_api.py", line 57, in create_namespaced_workflow
    (data) = self.create_namespaced_workflow_with_http_info(namespace, body, **kwargs)  # noqa: E501
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api/v1alpha1_api.py", line 138, in create_namespaced_workflow_with_http_info
    collection_formats=collection_formats)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api_client.py", line 330, in call_api
    _preload_content, _request_timeout)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api_client.py", line 169, in __call_api
    return_data = self.deserialize(response_data, response_type)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api_client.py", line 241, in deserialize
    return self.__deserialize(data, response_type)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api_client.py", line 280, in __deserialize
    return self.__deserialize_model(data, klass)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/api_client.py", line 626, in __deserialize_model
    instance = klass(**kwargs)
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/models/v1alpha1_workflow.py", line 66, in __init__
    self.status = status
  File "/home/pkrishnamurthy/workspace/git/snowflake/Tests/jenkins/Launch-ResilienceOrchestrator/venv/lib64/python3.6/site-packages/argo/workflows/client/models/v1alpha1_workflow.py", line 179, in status
    raise ValueError("Invalid value for `status`, must not be `None`")  # noqa: E501
ValueError: Invalid value for `status`, must not be `None

client version is : 2.4.1 and argo controller version is v2.5.0-rc10 .

I dont think this is an backwards compatibility issue as the api hasn't changed : https://github.com/CermakM/argo-client-python/pull/14/commits/9c7dbfc6b8a9d37c953ae2467df6f17b6adbdbfd#diff-2bb0c0b9af14856cdac36a4e7e8471c5R50

Kindly help me getting past this issue.

pkrishn6 commented 4 years ago

I printed the response object and I only see

KInd , apiVersion , metadata and spec Status is not part of the response object. I wonder how others do not hit this issue

pkrishn6 commented 4 years ago

Downgraded to 2.4.3 and the issue persists

CermakM commented 4 years ago

@pkrishn6 This is not an issue. It's a requirement of the Open API which requires status not to be None ... I know this is annoying, but you can simply add status: {} into a yaml file to go around that.

see https://github.com/argoproj/argo/blob/master/api/openapi-spec/swagger.json#L1574

pkrishn6 commented 4 years ago

@CermakM I agree that this is not an issue on the client side . Was curious how people bypassed the issue. I should have thought about adding a empty status object . Thanks for the tip