-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devfile components does not show up on odo catalog list components with -o json
flag
#3247
Comments
Should be a quick fix. I will create a PR for this issue. |
The json output format has been changed by this issue. The List will contain separate arrays for s2i items and devfile items. The detailed example list is shown as below.
|
@yangcao77 This approach will require to fix all IDE's after new Component Type is introduced. Look at example below. This implementation would work with all IDEs and 'New Component' workflow would not be affected, because both "dotnet" and "openLiberty" have json structure IDEs understand already. It means if experimental flag is set to true, IDEs will start showing devfile components in 'New Component' workflow and that does not require any code modification to support new Component Types. I would say that description, link and registry should not be required in this json output, because all what IDEs need is component_name:version used as part of {
"kind": "List",
"apiVersion": "odo.dev/v1alpha1",
"metadata": {
"creationTimestamp": null
},
"items": [
{
"kind": "ComponentType",
"apiVersion": "odo.dev/v1alpha1",
"metadata": {
"type": "S2I",
"name": "dotnet",
"namespace": "openshift",
"creationTimestamp": null
},
"spec": {
"allTags": [
"2.0",
"latest"
],
"nonHiddenTags": [
"2.0",
"latest"
],
"supportedTags": []
}
},
{
"kind": "ComponentType",
"apiVersion": "odo.dev/v1alpha1",
"metadata": {
"type": "devfile",
"name": "openLiberty",
"displayName": "Open Liberty",
"description": "Open Liberty microservice in Java",
"link": "/devfiles/openLiberty/devfile.yaml",
"Registry": {
"Name": "DefaultDevfileRegistry",
"URL": "https://raw.githubusercontent.com/elsony/devfile-registry/master"
},
"namespace": null,
"creationTimestamp": null
},
"spec": {
"allTags": [
"latest"
],
"nonHiddenTags": [
"latest"
],
"supportedTags": [
"latest"
]
}
},
]
} |
this issue is duplicate of #3091. |
@dgolovin s2iItems items and devfileItems cannot be simply merged and put into items list. They are with two different struct type. #3264 (comment) |
I just did in comment above. The IDE's relay on agreement that odo patch or service releases should stay backward compatible. |
@dgolovin |
@yangcao77 |
@dgolovin Had a discussion with @elsony and @GeekArthur . We still think having two separate lists make more sense in this case. |
The question is not about experimental mode or not but rather to the evolution of odo. For IDEs and userd, odo s there in order to hide the complexity of the underlying infrastructure (Openshift vs Kube vs Docker).
So Denis concern is that having Devfile components added should not cause the catalog list components to be changed. |
The problem is that the content of the information for the two different types of components (s2i vs devfile) are different. When it comes to IDE integration, if we try to ignore the fact that they are different and trying to handle them in the same way, we are going to provide a half-baked solution in the IDE. There are some fundamental differences between two models. Take registry support on devfile as an example: the registry information is part of the devfile model when returned from the catalog list but there is no such notion on the s2i model. If we try to create a component and just using the component type name as-is via the IDE and disregard the registry information, you may ending up creating the wrong component that the user wants, e.g. when component with the same name are coming from two different registries, and the user wants to create the component that is not comes with the default registry (high on the priority list), you'll need to pass in the registry information to complete the task properly; therefore, the notion of registry needs to be surface it up on the IDE side to the user for devfile component. Another example is the support of creating sample application for which the list of starter project is going to be returned as part of the catalog list. That does not exists on s2i type of component at all. Note: Keep in mind that the devfile change is a major change in concepts for odo, not just another type of component that we support. It is different enough that when devfile function is moving out of experimental mode, most likely odo is going to have a major version change. |
@elsony thank you for explanation and examples. Format above would let us discriminate components by type and provide workflow specific for component type, so we can ask registry url and any additional information required. Or we can simply show 'Not supported' message for unknown component types. Do you plan to support both kinds (s2i and devfile) of component types when devfile support goes out of experimental? |
@elsony @jeffmaury Supporting tools downloaded with CLI CRD is going to be challenging. We have to find a solution to provide IDE features for different tool versions that are not backward compatible. We are going to have multiple implementations for different versions and load them on demand based on tool version detected. |
Yes, patch release should stay compatible and we are trying to do that. |
/kind bug
What versions of software are you using?
1.2.1
Operating System:
mac
Output of
odo version
:odo v1.2.1 (b7b7c2f)
How did you run odo exactly?
Running the command 'odo catalog list components -o json' with experimental flag set to true
Actual behavior
It returns an empty list.
However, if I run the same command without
-o json
, the entries shows up correctly:Expected behavior
It should return the list of devfile components when
-o json
is specified.Any logs, error output, etc?
n/a
/area devfile
The text was updated successfully, but these errors were encountered: