Skip to content
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

CheCluster custom resource completion and docs are not available anymore on OpenShift 4.3 + #16860

Closed
3 of 9 tasks
davidfestal opened this issue May 7, 2020 · 10 comments
Closed
3 of 9 tasks
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@davidfestal
Copy link
Contributor

Describe the bug

In OpenShift 4.3 and later, the completion and documentation services provided in the console on custom resource YAML is broken for the CheCluster custom resource.

This is quite impacting since those services are very valuable for customers to have a quick and immediate knowledge of the various available Che installation options, as shown in the following screenshot:

image

Without the services, the user has no idea of the available options, apart from diving deep into the documentation.

This is broken because from OpenShift 4.3 version and later, the OpenApi schema of Custom Resource Definitions is expected to be valid according to constraints that are now stricter than in previous OpenShift versions.

Following changes to the latest CheCluster CRD file would be required to enable YAML language services again on the CheCluster custom resource:

  • Add the type: object field at the root of the OpenApi schema
  • Set the preserveUnknownFields CRD field to false. This should not hurt since we don't use fields that are not specified in the schema, and keep backward compatibility of existing fields when updating the CRD.

The above screenshot show the restored services on a OS 4.3 cluster as soon as these 2 changes are applied to the CRD.

This will allow getting back language services (completion / docs) on the CheCluster custom resource in the OpenShift Console for OpenShift 4.3 +

This bug has already been fixed in the CheCluster CRD included in CRW 2.1.1 release by this PR: redhat-developer/codeready-workspaces-operator#19

However the upstream Che general use-case is a bit trickier since we have to ensure compatibility of the CRD for OpenShift 3.11 when installing from chectl as well. So CRD generation scripts should take in account the fact that CRD in the raw deploy yaml will be slightly different (one compatible with 3.11 up to 4.2 the other one with OS 4.x.

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

Create a CheCluster custom resource in OpenShift 4.3 console after installing The Che operator, and you will miss yaml completion and documentation.

Expected behavior

Create a CheCluster custom resource in OpenShift 4.3 console after installing The Che operator, and you should get yaml completion and documentation.

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)
@davidfestal davidfestal added kind/bug Outline of a bug - must adhere to the bug report template. team/deploy labels May 7, 2020
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label May 7, 2020
@davidfestal davidfestal added the area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator label May 7, 2020
@tolusha tolusha added the severity/P1 Has a major impact to usage or development of the system. label May 7, 2020
@tolusha tolusha added this to the Backlog - Deploy milestone May 7, 2020
@flacatus flacatus removed the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label May 7, 2020
@tolusha tolusha mentioned this issue May 8, 2020
56 tasks
@tolusha
Copy link
Contributor

tolusha commented May 8, 2020

@davidfestal
My proposal:

  • Add type: object
    • it is enough to have completion and docs in OpenShift 4.x
    • it is fully compatible with OpenShift 3.11
  • Not to add preserveUnknownFields: false since
    • it is not needed to restore docs
    • not compatible with OpenShift 3.11
    • we have field keycloakPostgresPassword which is not defined in crd (I don't know why)

@davidfestal
Copy link
Contributor Author

@tolusha did you really try in OpenShift 4.3 + ? Afaik preserveUnknownFields: false is required for completion to work starting with OpenShift 4.3.
I'm also surprised that type: object is compatible with OpenShift 3.11/ There was precisely an issue that at some point forced us to remove it to ensure 3.11 compatibility.

we have field keycloakPostgresPassword which is not defined in crd (I don't know why)

That seems like a bug, no ?

@tolusha
Copy link
Contributor

tolusha commented May 12, 2020

For openshift 4.3, crd with type: object, autocomplition and docs work:
https://console-openshift-console.apps.ocp43.codereadyqe.com/k8s/ns/abazko/test.org.eclipse.che~v1~TestCheCluster/example/yaml

I tested on minikube for openshift 3.11.
I was able to create crd with type: object

That seems like a bug, no ?.

yes, I will fix it in the same PR

@davidfestal
Copy link
Contributor Author

@tolusha could you please update the issue with the result of the tests we did again today, and the updated proposed plan ?

@tolusha
Copy link
Contributor

tolusha commented May 14, 2020

@davidfestal
To have all functional working it is needed to add both type: object and preserveUnknownFields: false fields. Since these changes aren't compatible for OpenShift 3.11 we've decided to set those fields only in csv file (since installation from OperatorHub isn't supported for OpenShift 3.11 and we won't break anything)

@tolusha
Copy link
Contributor

tolusha commented May 18, 2020

Postponed to 7.13.1 release

@tolusha tolusha modified the milestones: Backlog - Deploy, 7.13 May 21, 2020
@tolusha
Copy link
Contributor

tolusha commented May 21, 2020

@tolusha tolusha closed this as completed May 21, 2020
@davidfestal davidfestal reopened this Oct 29, 2020
@davidfestal
Copy link
Contributor Author

@tolusha @nickboldt

It seems this has been fixed only in the 7.13.1 bugfix release, but never cherry-picked on master in nightlies, at least it never came into to the 7.14.1 and higher releases.

So as a result, it has been integrated in the downstream manifests only in the CRW 2.1.1 release, but disappeared since the 2.2.0 and higher CRW releases:

What I would suggest is:

@davidfestal
Copy link
Contributor Author

@tolusha As you mentioned it in a slack comment, I didn't see it was at a distinct place in the newer released versions in upstream Che operator repository.

However the problem is that the new nightly bundle doesn't have it: https://github.com/redhat-developer/codeready-workspaces-operator/blob/crw-2.5-rhel-8/manifests/codeready-workspaces.crd.yaml
Only release OLM packages have it, and the downstreaming is based on the nightly bundle.

@davidfestal
Copy link
Contributor Author

A fix has already been proposed by @tolusha in PR eclipse-che/che-operator#509

@tolusha tolusha closed this as completed Oct 30, 2020
@tolusha tolusha modified the milestones: 7.13, 7.22 Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/che-operator Issues and PRs related to Eclipse Che Kubernetes Operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants