atomicapp icon indicating copy to clipboard operation
atomicapp copied to clipboard

OpenShift provider doesn't support "kind: List'

Open kadel opened this issue 9 years ago • 9 comments

If OpenShift artifact contains List Atomic App fails:

2016-03-09 15:33:28,025 - __main__ - ERROR - Unsupported kind list in artifact artifacts/openshift/.artifacts.json
Traceback (most recent call last):
  File "/opt/atomicapp/atomicapp/cli/main.py", line 100, in cli_run
    nm.run(**argdict)
  File "/opt/atomicapp/atomicapp/nulecule/main.py", line 228, in run
    self.nulecule.run(cli_provider, dryrun)
  File "/opt/atomicapp/atomicapp/nulecule/base.py", line 161, in run
    component.run(provider_key, dryrun)
  File "/opt/atomicapp/atomicapp/nulecule/base.py", line 290, in run
    provider.init()
  File "/opt/atomicapp/atomicapp/providers/openshift.py", line 353, in init
    self._process_artifacts()
  File "/opt/atomicapp/atomicapp/providers/openshift.py", line 478, in _process_artifacts
    self._process_artifact_data(artifact, data)
  File "/opt/atomicapp/atomicapp/providers/openshift.py", line 500, in _process_artifact_data
    "Unsupported kind %s in artifact %s" % (kind, artifact))
ProviderFailedException: Unsupported kind list in artifact artifacts/openshift/.artifacts.json

artifact.json: https://gist.github.com/kadel/93b35f2744d536574455

This is because openshift provider gets all supported Kinds from OpenShift server but List is not on that list.

kadel avatar Mar 09 '16 15:03 kadel

This is because openshift provider gets all supported Kinds from OpenShift server but List is not on that list.

Is that a bug in openshift? Or something that is just implied that should work?

dustymabe avatar Mar 09 '16 15:03 dustymabe

@dustymabe I think this should be implemented in Atomic App

surajssd avatar Mar 09 '16 16:03 surajssd

Ok so basically having a json/yaml with more than one item in it (in a list) should work. Got it

dustymabe avatar Mar 09 '16 16:03 dustymabe

Are there any other possible key words (other than "List") that we could possibly expect?

dustymabe avatar Mar 09 '16 16:03 dustymabe

It don't think that this is bug in OpenShift. List is not really resource type like for example Pod or ReplicationController is, it is just container that holds array of other types.

I think that this is why it is not listed as available resource in Kubernetes or OpenShift API. Other reason for this is that there is no api call to handle list (or I didn't found it). So it looks like that it is up to client to parse list, and do appropriate api calls for each resource in List.

kadel avatar Mar 09 '16 16:03 kadel

Are there any other possible key words (other than "List") that we could possibly expect?

I'm not sure :-( I didn't find any list of all possible "kinds" in docs. I'll have to dig through OpenShift source :-(

kadel avatar Mar 09 '16 16:03 kadel

I found something that might help with regarding all the possible "Kinds". It is for Kubernetes but same rules should apply for OpenShift. https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md#types-kinds

kadel avatar Mar 10 '16 13:03 kadel

@kadel this also means we can use "List" for k8s as well?

surajssd avatar Mar 10 '16 13:03 surajssd

I found something that might help with regarding all the possible "Kinds". It is for Kubernetes but same rules should apply for OpenShift.

Agreed.

dustymabe avatar Mar 10 '16 17:03 dustymabe